├── bitbar ├── en.lproj │ └── InfoPlist.strings ├── Icons │ ├── btclogo.png │ └── btclogo@2x.png ├── bitbar-Prefix.pch ├── main.m ├── bitbar.entitlements ├── Fetchers │ ├── BTCeUSDFetcher.h │ ├── BitStampUSDFetcher.h │ ├── CoinbaseUSDFetcher.h │ ├── AstockFetcher.h │ ├── BTCCCNYFetcher.h │ ├── HaobtcCNYFetcher.h │ ├── HuobiCNYFetcher.h │ ├── Btc38.h │ ├── HaobtcInstantCNYFetcher.h │ ├── OKCoinCNYFetcher.h │ ├── ViaBCCFetcher.h │ ├── YunbiEOSFetcher.h │ ├── YunbiEtcFetcher.h │ ├── YunbiEthFetcher.h │ ├── OKCoinFutureUSDFetcher.h │ ├── WinkDexUSDFetcher.h │ ├── BitFinexUSDFetcher.h │ ├── PoloniexEtcFetcher.h │ ├── PoloniexEthFetcher.h │ ├── BTCeUSDFetcher.m │ ├── OKCoinCNYFetcher.m │ ├── BitStampUSDFetcher.m │ ├── CoinbaseUSDFetcher.m │ ├── BTCCCNYFetcher.m │ ├── YunbiEOSFetcher.m │ ├── YunbiEtcFetcher.m │ ├── YunbiEthFetcher.m │ ├── PoloniexEtcFetcher.m │ ├── PoloniexEthFetcher.m │ ├── ViaBCCFetcher.m │ ├── OKCoinFutureUSDFetcher.m │ ├── BitFinexUSDFetcher.m │ ├── HuobiCNYFetcher.m │ ├── WinkDexUSDFetcher.m │ ├── AstockFetcher.m │ ├── HaobtcInstantCNYFetcher.m │ ├── Btc38.m │ └── HaobtcCNYFetcher.m ├── Fetcher.h ├── AppDelegate.h ├── bitbar-Info.plist ├── Views │ └── MainMenu.xib └── AppDelegate.m ├── Resources ├── Icon.psd ├── Icon.icns ├── screenshot.png └── screenshot2.png ├── .gitignore ├── README.md └── bitbar.xcodeproj └── project.pbxproj /bitbar/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | -------------------------------------------------------------------------------- /Resources/Icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philsong/bitbar/HEAD/Resources/Icon.psd -------------------------------------------------------------------------------- /Resources/Icon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philsong/bitbar/HEAD/Resources/Icon.icns -------------------------------------------------------------------------------- /Resources/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philsong/bitbar/HEAD/Resources/screenshot.png -------------------------------------------------------------------------------- /Resources/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philsong/bitbar/HEAD/Resources/screenshot2.png -------------------------------------------------------------------------------- /bitbar/Icons/btclogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philsong/bitbar/HEAD/bitbar/Icons/btclogo.png -------------------------------------------------------------------------------- /bitbar/Icons/btclogo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/philsong/bitbar/HEAD/bitbar/Icons/btclogo@2x.png -------------------------------------------------------------------------------- /bitbar/bitbar-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'btcbar' target in the 'btcbar' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | Release 3 | */build/* 4 | 5 | # Xcode 6 | *.pbxuser 7 | *.mode1v3 8 | *.mode2v3 9 | *.perspectivev3 10 | *.xcuserstate 11 | project.xcworkspace/ 12 | xcuserdata/ 13 | -------------------------------------------------------------------------------- /bitbar/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // btcbar 4 | // 5 | 6 | #import 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | return NSApplicationMain(argc, (const char **)argv); 11 | } 12 | -------------------------------------------------------------------------------- /bitbar/bitbar.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.network.client 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BTCeUSDFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // BTCeUSDFetcher.h 3 | // btcbar 4 | // 5 | 6 | #import 7 | #import "Fetcher.h" 8 | 9 | @interface BTCeUSDFetcher : NSObject 10 | 11 | @property (nonatomic) NSString* ticker; 12 | @property (nonatomic) NSString* ticker_menu; 13 | @property (nonatomic) NSString* url; 14 | @property (nonatomic) NSError* error; 15 | @property (nonatomic) NSMutableData *responseData; 16 | 17 | - (void)requestUpdate; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BitStampUSDFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // BitStampUSDFetcher.h 3 | // btcbar 4 | // 5 | 6 | #import 7 | #import "Fetcher.h" 8 | 9 | @interface BitStampUSDFetcher : NSObject 10 | 11 | @property (nonatomic) NSString* ticker; 12 | @property (nonatomic) NSString* ticker_menu; 13 | @property (nonatomic) NSString* url; 14 | @property (nonatomic) NSError* error; 15 | @property (nonatomic) NSMutableData *responseData; 16 | 17 | - (void)requestUpdate; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /bitbar/Fetchers/CoinbaseUSDFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // CoinbaseUSDFetcher.h 3 | // btcbar 4 | // 5 | 6 | #import 7 | #import "Fetcher.h" 8 | 9 | @interface CoinbaseUSDFetcher : NSObject 10 | 11 | @property (nonatomic) NSString* ticker; 12 | @property (nonatomic) NSString* ticker_menu; 13 | @property (nonatomic) NSString* url; 14 | @property (nonatomic) NSError* error; 15 | @property (nonatomic) NSMutableData *responseData; 16 | 17 | - (void)requestUpdate; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /bitbar/Fetchers/AstockFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // AstockFetcher.h 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface AstockFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | @end 20 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BTCCCNYFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.h 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface BTCCCNYFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /bitbar/Fetchers/HaobtcCNYFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.h 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface HaobtcCNYFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /bitbar/Fetchers/HuobiCNYFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.h 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface HuobiCNYFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /bitbar/Fetchers/Btc38.h: -------------------------------------------------------------------------------- 1 | // 2 | // Btc38.h 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | 13 | @interface Btc38 :NSObject 14 | 15 | @property (nonatomic) NSString* ticker; 16 | @property (nonatomic) NSString* ticker_menu; 17 | @property (nonatomic) NSString* url; 18 | @property (nonatomic) NSError* error; 19 | @property (nonatomic) NSMutableData *responseData; 20 | 21 | - (void)requestUpdate; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /bitbar/Fetchers/HaobtcInstantCNYFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.h 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface HaobtcInstantCNYFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /bitbar/Fetchers/OKCoinCNYFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinCYNFetcher.h 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface OKCoinCNYFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/ViaBCCFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface ViaBCCFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/YunbiEOSFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface YunbiEOSFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/YunbiEtcFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface YunbiEtcFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/YunbiEthFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface YunbiEthFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // Fetcher.h 3 | // btcbar 4 | // 5 | 6 | #import 7 | 8 | @protocol Fetcher 9 | 10 | // Current title in the menu 11 | @property (nonatomic) NSString* ticker_menu; 12 | 13 | // Current price of the ticker, including currency symbol 14 | @property (nonatomic) NSString* ticker; 15 | 16 | // URL that the "Open in Browser" option opens 17 | @property (nonatomic) NSString* url; 18 | 19 | // Error message if ticker returns nil 20 | @property (nonatomic) NSError* error; 21 | 22 | // Trigger a refresh, update `ticker` when it completes 23 | - (void)requestUpdate; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /bitbar/Fetchers/OKCoinFutureUSDFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinCYNFetcher.h 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface OKCoinFutureUSDFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/WinkDexUSDFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // WinkDexUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface WinkDexUSDFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BitFinexUSDFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // BitFinexUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface BitFinexUSDFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/PoloniexEtcFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface PoloniexEtcFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/Fetchers/PoloniexEthFetcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.h 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "Fetcher.h" 11 | 12 | @interface PoloniexEthFetcher : NSObject 13 | 14 | @property (nonatomic) NSString* ticker; 15 | @property (nonatomic) NSString* ticker_menu; 16 | @property (nonatomic) NSString* url; 17 | @property (nonatomic) NSError* error; 18 | @property (nonatomic) NSMutableData *responseData; 19 | 20 | - (void)requestUpdate; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /bitbar/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // btcbar 4 | // 5 | 6 | #import 7 | 8 | 9 | @interface AppDelegate : NSObject { 10 | NSMenu *btcbarMainMenu; 11 | NSInteger currentFetcherTag; 12 | 13 | NSStatusItem *btcbarStatusItem; 14 | 15 | // NSTimer *updateViewTimer; 16 | NSTimer *updateDataTimer; 17 | 18 | NSMutableArray *tickers; 19 | NSUserDefaults *prefs; 20 | } 21 | 22 | - (void)menuActionSetTicker:(id)sender; 23 | - (void)menuActionBrowser:(id)sender; 24 | - (void)menuActionAbout:(id)sender; 25 | - (void)menuActionQuit:(id)sender; 26 | 27 | - (void)handleTickerNotification:(NSNotification *)pNotification; 28 | - (void)updateDataTimerAction:(NSTimer*)timer; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /bitbar/bitbar-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | Icon 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 4.0.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 13 25 | LSApplicationCategoryType 26 | public.app-category.finance 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | LSUIElement 30 | 31 | NSAppTransportSecurity 32 | 33 | NSAllowsArbitraryLoads 34 | 35 | 36 | NSHumanReadableCopyright 37 | bitui.io (2015) 38 | NSMainNibFile 39 | MainMenu 40 | NSPrincipalClass 41 | NSApplication 42 | 43 | 44 | -------------------------------------------------------------------------------- /bitbar/Views/MainMenu.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | btcbar 2 | ====== 3 | 4 | A tiny status bar widget for OS X that displays the latest USD/BTC spot price from several USD and CNY exchanges. 5 | 6 | ## Screenshot 7 | 8 | Here is how btcbar looks in your status bar: 9 | 10 | ![Screenshot](https://raw.github.com/nearengine/btcbar/master/Resources/screenshot.png) 11 | 12 | And how you can select a ticker: 13 | 14 | ![Menu Screenshot](https://raw.github.com/nearengine/btcbar/master/Resources/screenshot2.png) 15 | 16 | ## Installation 17 | 18 | Simply place btcbar.app in your `/Applications` folder, and optionally add it to `Login Items` in `System Preferences > Users & Groups` to display it automatically on startup. 19 | 20 | ## Download 21 | 22 | The current version of btcbar (3.1.0) can be downloaded here: 23 | 24 | https://github.com/philsong/btcbar/releases/download/3.1.0/btcbar.zip 25 | 26 | It requires OS X 10.7+ and a 64-bit processor. 27 | 28 | ## Changelog 29 | 30 | ### 4.0.0 31 | * Add the ViaBTC BCC price. 32 | * 33 | ### 3.1.0 34 | * Add the Yunbi EOS price. 35 | 36 | ### 2.9.0 37 | * Add the Yunbi and Poloniex ETC price, remove the Haobtc benchmark price. 38 | 39 | ### 2.8.0 40 | * Add the Haobtc exchange price 41 | 42 | ### 2.7.0 43 | * Add the Yunbi and Poloniex ETH price. 44 | 45 | ### 2.6.0 46 | * Fixs Huobi, adds BTCC, OKCoin future, supports the k-line of sosobtc, removes btc38 and stock market. 47 | 48 | ### 2.5.0 49 | * Adds HaobtcCNY 50 | 51 | ### 2.4.0 52 | * Adds China Stock market 53 | 54 | ### 2.3.0 55 | * Adds btc38 XRP/BTS 56 | 57 | ### 2.2.1 58 | 59 | * Fix bug where icon disappears on error 60 | 61 | ### 2.2.0 62 | 63 | * Adds BitFinexUSD, WinkDexUSD, HuobiCNY and OKCoinCNY 64 | * New status bar icon with Yosemite (dark theme) support 65 | 66 | ### 2.1.4 67 | 68 | * Removes MtGox 69 | 70 | ### 2.1.3 71 | 72 | * Fixes issue where the local currency code was displayed instead of the USD symbol 73 | * Improves error handling: if there is an error, the icon will fade and a descriptive error will be displayed in the tooltip when hovering over btcbar rather than taking up space in your menu bar 74 | 75 | ### 2.1.2 76 | 77 | * Uses new HTTPS MtGox API to fix "json error" 78 | * Better organization for repo and XCode project 79 | * Standardizes use of commas in tickers 80 | 81 | ### 2.1.1 82 | 83 | * Enables live prices in menu 84 | * Fixes a minor bug in the ticker switching code 85 | 86 | ### 2.1.0 87 | 88 | * New BTCe/USD ticker 89 | * Manually refreshes when a ticker is clicked 90 | * Decreases disk io/cpu time/power usage 91 | * Greatly increases modularity (tickers now have a protocol, menu is dynamically generated) 92 | 93 | ### 2.0.0 94 | 95 | * Adds Bitstamp and Coinbase, and a little better backend abstraction so it will be easier to add future tickers. 96 | 97 | TODO: 98 | * Live updating prices for each menu item in the dropdown 99 | * More robust abstraction of tickers/dynamic menu 100 | 101 | ### 1.0.0 102 | 103 | * The first release, which uses MtGox's USD ticker API. 104 | 105 | ## License 106 | 107 | This project currently retains my copyright, although I am considering moving to a FOSS license as it matures. 108 | 109 | The source is provided for inspection, considering the nature of Bitcoin. You are free to download and build for personal use, but please don't redistribute this project yet. 110 | 111 | ## Donate 112 | 113 | If for some reason you feel like donating a few micro btc to future development, those should go here: 114 | 115 | `1D3NtjVFpoXonqk3MZwsYD9iV5WA7MRXUj` 116 | 117 | ## Credits 118 | 119 | * @[chrisshiplet](https://github.com/chrisshiplet/) for [the original work on **btcbar**](https://github.com/chrisshiplet/btcbar) 120 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BTCeUSDFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // BTCeUSDFetcher.m 3 | // btcbar 4 | // 5 | 6 | #import "BTCeUSDFetcher.h" 7 | 8 | @implementation BTCeUSDFetcher 9 | 10 | - (id)init 11 | { 12 | if (self = [super init]) 13 | { 14 | // Menu Item Name 15 | self.ticker_menu = @"BTCe"; 16 | 17 | // Website location 18 | self.url = @"http://k.sosobtc.com/btc_btce.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 19 | 20 | // Immediately request first update 21 | [self requestUpdate]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | // Override Ticker setter to trigger status item update 28 | - (void)setTicker:(NSString *)tickerString 29 | { 30 | // Update the ticker value 31 | _ticker = tickerString; 32 | 33 | // Trigger notification to update ticker 34 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 35 | } 36 | 37 | // Initiates an asyncronous HTTP connection 38 | - (void)requestUpdate 39 | { 40 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://btc-e.com/api/2/btc_usd/ticker"]]; 41 | 42 | // Set the request's user agent 43 | [request addValue:@"bitbar/4.0 (BTCeUSDFetcher)" forHTTPHeaderField:@"User-Agent"]; 44 | 45 | // Initialize a connection from our request 46 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 47 | 48 | // Go go go 49 | [connection start]; 50 | } 51 | 52 | // Initializes data storage on request response 53 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 54 | { 55 | self.responseData = [[NSMutableData alloc] init]; 56 | } 57 | 58 | // Appends response data 59 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 60 | { 61 | [self.responseData appendData:data]; 62 | } 63 | 64 | // Indiciate no caching 65 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 66 | { 67 | return nil; 68 | } 69 | 70 | // Parse data after load 71 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 72 | { 73 | // Parse the JSON into results 74 | NSError *jsonParsingError = nil; 75 | NSDictionary *results = [[NSDictionary alloc] init]; 76 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 77 | 78 | // Results parsed successfully from JSON 79 | if(results) 80 | { 81 | 82 | if ([[results objectForKey:@"ticker"] objectForKey:@"last"]) 83 | { 84 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 85 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; 86 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 87 | self.ticker = [currencyStyle stringFromNumber:[[results objectForKey:@"ticker"] objectForKey:@"last"]]; 88 | } 89 | else 90 | { 91 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 92 | self.ticker = nil; 93 | } 94 | } 95 | // JSON parsing failed 96 | else 97 | { 98 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 99 | self.ticker = nil; 100 | } 101 | } 102 | 103 | // HTTP request failed 104 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 105 | { 106 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to BTCe.", NSLocalizedFailureReasonErrorKey, nil]]; 107 | self.ticker = nil; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /bitbar/Fetchers/OKCoinCNYFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinCYNFetcher.m 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import "OKCoinCNYFetcher.h" 10 | 11 | @implementation OKCoinCNYFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"OKCoin BTC"; 19 | 20 | // Website location 21 | self.url = @"http://k.sosobtc.com/btc_okcoin.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.okcoin.cn/api/v1/ticker.do?symbol=btc_cny"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (OKCoinCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker = [results objectForKey:@"ticker"]; 86 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 87 | 88 | 89 | // If API call succeeded update the ticker... 90 | if(resultsStatus) 91 | { 92 | resultsStatus = [NSString stringWithFormat:@"¥%@", resultsStatus]; 93 | 94 | self.ticker = resultsStatus; 95 | } 96 | // Otherwise log an error... 97 | else 98 | { 99 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 100 | self.ticker = nil; 101 | } 102 | } 103 | // JSON parsing failed 104 | else 105 | { 106 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 107 | self.ticker = nil; 108 | } 109 | } 110 | 111 | // HTTP request failed 112 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 113 | { 114 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 115 | self.ticker = nil; 116 | } 117 | 118 | @end 119 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BitStampUSDFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // BitStampUSDFetcher.m 3 | // btcbar 4 | // 5 | 6 | #import "BitStampUSDFetcher.h" 7 | 8 | @implementation BitStampUSDFetcher 9 | 10 | - (id)init 11 | { 12 | if (self = [super init]) 13 | { 14 | // Menu Item Name 15 | self.ticker_menu = @"BitStamp"; 16 | 17 | // Website location 18 | self.url = @"http://k.sosobtc.com/btc_bitstamp.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 19 | 20 | // Immediately request first update 21 | [self requestUpdate]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | // Override Ticker setter to trigger status item update 28 | - (void)setTicker:(NSString *)tickerString 29 | { 30 | // Update the ticker value 31 | _ticker = tickerString; 32 | 33 | // Trigger notification to update ticker 34 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 35 | } 36 | 37 | // Initiates an asyncronous HTTP connection 38 | - (void)requestUpdate 39 | { 40 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.bitstamp.net/api/ticker/"]]; 41 | 42 | // Set the request's user agent 43 | [request addValue:@"bitbar/4.0 (BitStampUSDFetcher)" forHTTPHeaderField:@"User-Agent"]; 44 | 45 | // Initialize a connection from our request 46 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 47 | 48 | // Go go go 49 | [connection start]; 50 | } 51 | 52 | // Initializes data storage on request response 53 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 54 | { 55 | self.responseData = [[NSMutableData alloc] init]; 56 | } 57 | 58 | // Appends response data 59 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 60 | { 61 | [self.responseData appendData:data]; 62 | } 63 | 64 | // Indiciate no caching 65 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 66 | { 67 | return nil; 68 | } 69 | 70 | // Parse data after load 71 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 72 | { 73 | // Parse the JSON into results 74 | NSError *jsonParsingError = nil; 75 | NSDictionary *results = [[NSDictionary alloc] init]; 76 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 77 | 78 | // Results parsed successfully from JSON 79 | if(results) 80 | { 81 | // Get API status 82 | NSString *resultsStatus = [results objectForKey:@"last"]; 83 | 84 | // If API call succeeded update the ticker... 85 | if(resultsStatus) 86 | { 87 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 88 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; 89 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 90 | resultsStatus = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 91 | self.ticker = resultsStatus; 92 | } 93 | // Otherwise log an error... 94 | else 95 | { 96 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 97 | self.ticker = nil; 98 | } 99 | } 100 | // JSON parsing failed 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | 108 | // HTTP request failed 109 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 110 | { 111 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to BitStamp.", NSLocalizedFailureReasonErrorKey, nil]]; 112 | self.ticker = nil; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /bitbar/Fetchers/CoinbaseUSDFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // CoinbaseUSDFetcher.m 3 | // btcbar 4 | // 5 | 6 | #import "CoinbaseUSDFetcher.h" 7 | 8 | @implementation CoinbaseUSDFetcher 9 | 10 | - (id)init 11 | { 12 | if (self = [super init]) 13 | { 14 | // Menu Item Name 15 | self.ticker_menu = @"Coinbase"; 16 | 17 | // Website location 18 | self.url = @"http://k.sosobtc.com/btc_coinbase.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 19 | 20 | // Immediately request first update 21 | [self requestUpdate]; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | // Override Ticker setter to trigger status item update 28 | - (void)setTicker:(NSString *)tickerString 29 | { 30 | // Update the ticker value 31 | _ticker = tickerString; 32 | 33 | // Trigger notification to update ticker 34 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 35 | } 36 | 37 | // Initiates an asyncronous HTTP connection 38 | - (void)requestUpdate 39 | { 40 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://coinbase.com/api/v1/prices/spot_rate"]]; 41 | 42 | // Set the request's user agent 43 | [request addValue:@"bitbar/4.0 (CoinbaseUSDFetcher)" forHTTPHeaderField:@"User-Agent"]; 44 | 45 | // Initialize a connection from our request 46 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 47 | 48 | // Go go go 49 | [connection start]; 50 | } 51 | 52 | // Initializes data storage on request response 53 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 54 | { 55 | self.responseData = [[NSMutableData alloc] init]; 56 | } 57 | 58 | // Appends response data 59 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 60 | { 61 | [self.responseData appendData:data]; 62 | } 63 | 64 | // Indiciate no caching 65 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 66 | { 67 | return nil; 68 | } 69 | 70 | // Parse data after load 71 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 72 | { 73 | // Parse the JSON into results 74 | NSError *jsonParsingError = nil; 75 | NSDictionary *results = [[NSDictionary alloc] init]; 76 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 77 | 78 | // Results parsed successfully from JSON 79 | if(results) 80 | { 81 | // Get API status 82 | NSString *resultsStatus = [results objectForKey:@"amount"]; 83 | 84 | // If API call succeeded update the ticker... 85 | if(resultsStatus) 86 | { 87 | NSDecimalNumber *resultsStatusNumber = [NSDecimalNumber decimalNumberWithString:resultsStatus]; 88 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 89 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; 90 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 91 | self.ticker = [currencyStyle stringFromNumber:resultsStatusNumber]; 92 | } 93 | // Otherwise log an error... 94 | else 95 | { 96 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 97 | self.ticker = nil; 98 | } 99 | } 100 | // JSON parsing failed 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | 108 | // HTTP request failed 109 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 110 | { 111 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to Coinbase.", NSLocalizedFailureReasonErrorKey, nil]]; 112 | self.ticker = nil; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BTCCCNYFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.m 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import "BTCCCNYFetcher.h" 10 | 11 | @implementation BTCCCNYFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"BTCC"; 19 | 20 | // Website location 21 | self.url = @"http://k.sosobtc.com/btc_btcchina.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://data.btcchina.com/data/ticker?market=btccny"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (BTCCCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | NSString *responseStr = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; 77 | if (!responseStr) { 78 | return; 79 | } 80 | 81 | NSString *resultsStr = responseStr; 82 | 83 | // Parse the JSON into results 84 | NSError *jsonParsingError = nil; 85 | id results = [NSJSONSerialization JSONObjectWithData:[resultsStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&jsonParsingError]; 86 | 87 | // Results parsed successfully from JSON 88 | if (results) 89 | { 90 | NSDictionary *ticker_resp = [results objectForKey:@"ticker"]; 91 | NSString *ticker = [ticker_resp objectForKey:@"last"]; 92 | 93 | if (ticker) { 94 | // NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; 95 | NSString *resultsStatus = [[NSString alloc] init]; 96 | resultsStatus = [NSString stringWithFormat:@"¥%@", ticker]; 97 | 98 | self.error = nil; 99 | self.ticker = resultsStatus; 100 | } 101 | // Otherwise log an error... 102 | else 103 | { 104 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 105 | self.ticker = nil; 106 | } 107 | } 108 | // JSON parsing failed 109 | else 110 | { 111 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 112 | self.ticker = nil; 113 | } 114 | } 115 | 116 | // HTTP request failed 117 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 118 | { 119 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to Huobi.", NSLocalizedFailureReasonErrorKey, nil]]; 120 | self.ticker = nil; 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /bitbar/Fetchers/YunbiEOSFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "YunbiEOSFetcher.h" 10 | 11 | @implementation YunbiEOSFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"云币 EOS"; 19 | 20 | // Website location 21 | self.url = @"https://k.sosobtc.com/eos_yunbi.html"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://yunbi.com//api/v2/tickers/eoscny.json"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (YunbiEthFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker = [results objectForKey:@"ticker"]; 86 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 87 | 88 | 89 | 90 | // If API call succeeded update the ticker... 91 | if(resultsStatus) 92 | { 93 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 94 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh-CN"]; 95 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 96 | 97 | self.error = nil; 98 | self.ticker = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 99 | } 100 | // Otherwise log an error... 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | // JSON parsing failed 108 | else 109 | { 110 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 111 | self.ticker = nil; 112 | } 113 | } 114 | 115 | // HTTP request failed 116 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 117 | { 118 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 119 | self.ticker = nil; 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /bitbar/Fetchers/YunbiEtcFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "YunbiEtcFetcher.h" 10 | 11 | @implementation YunbiEtcFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"云币 ETC"; 19 | 20 | // Website location 21 | self.url = @"https://k.sosobtc.com/etc_yunbi.html"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://yunbi.com//api/v2/tickers/etccny.json"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (YunbiEthFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker = [results objectForKey:@"ticker"]; 86 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 87 | 88 | 89 | 90 | // If API call succeeded update the ticker... 91 | if(resultsStatus) 92 | { 93 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 94 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh-CN"]; 95 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 96 | 97 | self.error = nil; 98 | self.ticker = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 99 | } 100 | // Otherwise log an error... 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | // JSON parsing failed 108 | else 109 | { 110 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 111 | self.ticker = nil; 112 | } 113 | } 114 | 115 | // HTTP request failed 116 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 117 | { 118 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 119 | self.ticker = nil; 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /bitbar/Fetchers/YunbiEthFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "YunbiEthFetcher.h" 10 | 11 | @implementation YunbiEthFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"云币 ETH"; 19 | 20 | // Website location 21 | self.url = @"https://k.sosobtc.com/eth_yunbi.html"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://yunbi.com//api/v2/tickers/ethcny.json"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (YunbiEthFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker = [results objectForKey:@"ticker"]; 86 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 87 | 88 | 89 | 90 | // If API call succeeded update the ticker... 91 | if(resultsStatus) 92 | { 93 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 94 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh-CN"]; 95 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 96 | 97 | self.error = nil; 98 | self.ticker = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 99 | } 100 | // Otherwise log an error... 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | // JSON parsing failed 108 | else 109 | { 110 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 111 | self.ticker = nil; 112 | } 113 | } 114 | 115 | // HTTP request failed 116 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 117 | { 118 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 119 | self.ticker = nil; 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /bitbar/Fetchers/PoloniexEtcFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "PoloniexEtcFetcher.h" 10 | 11 | @implementation PoloniexEtcFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"Poloniex ETC"; 19 | 20 | // Website location 21 | self.url = @"https://poloniex.com"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://poloniex.com/public?command=returnTicker"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (PoloniexEthFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker = [results objectForKey:@"USDT_ETC"]; 86 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 87 | 88 | 89 | 90 | // If API call succeeded update the ticker... 91 | if(resultsStatus) 92 | { 93 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 94 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"]; 95 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 96 | 97 | self.error = nil; 98 | self.ticker = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 99 | } 100 | // Otherwise log an error... 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | // JSON parsing failed 108 | else 109 | { 110 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 111 | self.ticker = nil; 112 | } 113 | } 114 | 115 | // HTTP request failed 116 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 117 | { 118 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 119 | self.ticker = nil; 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /bitbar/Fetchers/PoloniexEthFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "PoloniexEthFetcher.h" 10 | 11 | @implementation PoloniexEthFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"Poloniex ETH"; 19 | 20 | // Website location 21 | self.url = @"https://poloniex.com"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://poloniex.com/public?command=returnTicker"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (PoloniexEthFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker = [results objectForKey:@"USDT_ETH"]; 86 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 87 | 88 | 89 | 90 | // If API call succeeded update the ticker... 91 | if(resultsStatus) 92 | { 93 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 94 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en-US"]; 95 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 96 | 97 | self.error = nil; 98 | self.ticker = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 99 | } 100 | // Otherwise log an error... 101 | else 102 | { 103 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 104 | self.ticker = nil; 105 | } 106 | } 107 | // JSON parsing failed 108 | else 109 | { 110 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 111 | self.ticker = nil; 112 | } 113 | } 114 | 115 | // HTTP request failed 116 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 117 | { 118 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 119 | self.ticker = nil; 120 | } 121 | 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /bitbar/Fetchers/ViaBCCFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "ViaBCCFetcher.h" 10 | 11 | @implementation ViaBCCFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"ViaBTC BCC"; 19 | 20 | // Website location 21 | self.url = @"https://k.sosobtc.com/bcc_viabtc.html"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.viabtc.com/api/v1/market/ticker?market=BCCCNY"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (ViabtcFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *data = [results objectForKey:@"data"]; 86 | NSDictionary *ticker = [data objectForKey:@"ticker"]; 87 | NSString *resultsStatus = [ticker objectForKey:@"last"]; 88 | 89 | // If API call succeeded update the ticker... 90 | if(resultsStatus) 91 | { 92 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 93 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh-CN"]; 94 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 95 | 96 | self.error = nil; 97 | self.ticker = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 98 | } 99 | // Otherwise log an error... 100 | else 101 | { 102 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 103 | self.ticker = nil; 104 | } 105 | } 106 | // JSON parsing failed 107 | else 108 | { 109 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 110 | self.ticker = nil; 111 | } 112 | } 113 | 114 | // HTTP request failed 115 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 116 | { 117 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 118 | self.ticker = nil; 119 | } 120 | 121 | 122 | @end 123 | -------------------------------------------------------------------------------- /bitbar/Fetchers/OKCoinFutureUSDFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // OKCoinCYNFetcher.m 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import "OKCoinFutureUSDFetcher.h" 10 | 11 | @implementation OKCoinFutureUSDFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"OKEx季度合约"; 19 | 20 | // Website location 21 | self.url = @"http://k.sosobtc.com/btcquarter_okcoinfutures.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://www.okex.com/api/v1/future_ticker.do?symbol=btc_usd&contract_type=quarter"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (OKCoinFutureUSDFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSDictionary *ticker_resp = [results objectForKey:@"ticker"]; 86 | NSNumber *ticker = [ticker_resp objectForKey:@"last"]; 87 | 88 | 89 | // If API call succeeded update the ticker... 90 | if(ticker) 91 | { 92 | NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; 93 | [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; 94 | NSString *resultsStatus = [numberFormatter stringFromNumber:ticker]; 95 | resultsStatus = [NSString stringWithFormat:@"$%@", resultsStatus]; 96 | 97 | self.ticker = resultsStatus; 98 | } 99 | // Otherwise log an error... 100 | else 101 | { 102 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 103 | self.ticker = nil; 104 | } 105 | } 106 | // JSON parsing failed 107 | else 108 | { 109 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 110 | self.ticker = nil; 111 | } 112 | } 113 | 114 | // HTTP request failed 115 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 116 | { 117 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to OKCoin.", NSLocalizedFailureReasonErrorKey, nil]]; 118 | self.ticker = nil; 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /bitbar/Fetchers/BitFinexUSDFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // BitFinexUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "BitFinexUSDFetcher.h" 10 | 11 | @implementation BitFinexUSDFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"BitFinex"; 19 | 20 | // Website location 21 | self.url = @"http://k.sosobtc.com/btc_bitfinex.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | // More information on the API 44 | // can be found here: https://www.bitfinex.com/pages/api 45 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.bitfinex.com/v1/pubticker/BTCUSD/"]]; 46 | 47 | // Set the request's user agent 48 | [request addValue:@"bitbar/4.0 (BitFinexUSDFetcher)" forHTTPHeaderField:@"User-Agent"]; 49 | 50 | // Initialize a connection from our request 51 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 52 | 53 | // Go go go 54 | [connection start]; 55 | } 56 | 57 | // Initializes data storage on request response 58 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 59 | { 60 | self.responseData = [[NSMutableData alloc] init]; 61 | } 62 | 63 | // Appends response data 64 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 65 | { 66 | [self.responseData appendData:data]; 67 | } 68 | 69 | // Indiciate no caching 70 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 71 | { 72 | return nil; 73 | } 74 | 75 | // Parse data after load 76 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 77 | { 78 | // Parse the JSON into results 79 | NSError *jsonParsingError = nil; 80 | NSDictionary *results = [[NSDictionary alloc] init]; 81 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 82 | 83 | // Results parsed successfully from JSON 84 | if(results) 85 | { 86 | // Get API status 87 | NSString *resultsStatus = [results objectForKey:@"last_price"]; 88 | 89 | // If API call succeeded update the ticker... 90 | if(resultsStatus) 91 | { 92 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 93 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; 94 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 95 | resultsStatus = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 96 | self.ticker = resultsStatus; 97 | } 98 | // Otherwise log an error... 99 | else 100 | { 101 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 102 | self.ticker = nil; 103 | } 104 | } 105 | // JSON parsing failed 106 | else 107 | { 108 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 109 | self.ticker = nil; 110 | } 111 | } 112 | 113 | // HTTP request failed 114 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 115 | { 116 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to BitFinex.", NSLocalizedFailureReasonErrorKey, nil]]; 117 | self.ticker = nil; 118 | } 119 | 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /bitbar/Fetchers/HuobiCNYFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.m 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import "HuobiCNYFetcher.h" 10 | 11 | @implementation HuobiCNYFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"Huobi BTC"; 19 | 20 | // Website location 21 | self.url = @"http://k.sosobtc.com/btc_huobi.html?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://api.huobi.com/staticmarket/ticker_btc_json.js"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (HuobiCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | NSString *responseStr = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; 77 | if (!responseStr) { 78 | return; 79 | } 80 | 81 | NSString *resultsStr = responseStr; 82 | 83 | // Parse the JSON into results 84 | NSError *jsonParsingError = nil; 85 | id results = [NSJSONSerialization JSONObjectWithData:[resultsStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&jsonParsingError]; 86 | 87 | // Results parsed successfully from JSON 88 | if (results) 89 | { 90 | NSDictionary *ticker_resp = [results objectForKey:@"ticker"]; 91 | NSNumber *ticker = [ticker_resp objectForKey:@"last"]; 92 | 93 | if (ticker) { 94 | NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; 95 | [numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; 96 | NSString *resultsStatus = [numberFormatter stringFromNumber:ticker]; 97 | resultsStatus = [NSString stringWithFormat:@"¥%@", resultsStatus]; 98 | 99 | self.error = nil; 100 | self.ticker = resultsStatus; 101 | } 102 | // Otherwise log an error... 103 | else 104 | { 105 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 106 | self.ticker = nil; 107 | } 108 | } 109 | // JSON parsing failed 110 | else 111 | { 112 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 113 | self.ticker = nil; 114 | } 115 | } 116 | 117 | // HTTP request failed 118 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 119 | { 120 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to Huobi.", NSLocalizedFailureReasonErrorKey, nil]]; 121 | self.ticker = nil; 122 | } 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /bitbar/Fetchers/WinkDexUSDFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // WinkDexUSDFetcher.m 3 | // btcbar 4 | // 5 | // Created by Tim Daubenschütz on 22/01/15. 6 | // Copyright (c) 2015 nearengine. All rights reserved. 7 | // 8 | 9 | #import "WinkDexUSDFetcher.h" 10 | 11 | @implementation WinkDexUSDFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"WinkDexBTC"; 19 | 20 | // Website location 21 | self.url = @"https://winkdex.com/"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | // Documentation for this API 44 | // can be found here: http://docs.winkdex.com/#get-request 45 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://winkdex.com/api/v0/price"]]; 46 | 47 | // Set the request's user agent 48 | [request addValue:@"bitbar/4.0 (WinkDexUSDFetcher)" forHTTPHeaderField:@"User-Agent"]; 49 | 50 | // Initialize a connection from our request 51 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 52 | 53 | // Go go go 54 | [connection start]; 55 | } 56 | 57 | // Initializes data storage on request response 58 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 59 | { 60 | self.responseData = [[NSMutableData alloc] init]; 61 | } 62 | 63 | // Appends response data 64 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 65 | { 66 | [self.responseData appendData:data]; 67 | } 68 | 69 | // Indiciate no caching 70 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 71 | { 72 | return nil; 73 | } 74 | 75 | // Parse data after load 76 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 77 | { 78 | // Parse the JSON into results 79 | NSError *jsonParsingError = nil; 80 | NSDictionary *results = [[NSDictionary alloc] init]; 81 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 82 | 83 | // Results parsed successfully from JSON 84 | if(results) 85 | { 86 | // Get API status 87 | NSString *resultsStatus = [results objectForKey:@"price"]; 88 | 89 | // If API call succeeded update the ticker... 90 | if(resultsStatus) 91 | { 92 | NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 93 | currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US"]; 94 | currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 95 | 96 | // We first need to convert the price form pennys to dollars 97 | // then we can asign it to the view. 98 | NSDecimalNumber *price = [[NSDecimalNumber alloc] initWithDouble:[resultsStatus doubleValue]/100]; 99 | resultsStatus = [currencyStyle stringFromNumber:price]; 100 | self.ticker = resultsStatus; 101 | } 102 | // Otherwise log an error... 103 | else 104 | { 105 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 106 | self.ticker = nil; 107 | } 108 | } 109 | // JSON parsing failed 110 | else 111 | { 112 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 113 | self.ticker = nil; 114 | } 115 | } 116 | 117 | // HTTP request failed 118 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 119 | { 120 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to WinkDex.", NSLocalizedFailureReasonErrorKey, nil]]; 121 | self.ticker = nil; 122 | } 123 | 124 | 125 | @end 126 | -------------------------------------------------------------------------------- /bitbar/Fetchers/AstockFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // AstockFetcher.m 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import "AstockFetcher.h" 10 | 11 | @implementation AstockFetcher 12 | 13 | 14 | - (id)init 15 | { 16 | if (self = [super init]) 17 | { 18 | // Menu Item Name 19 | self.ticker_menu = @"China A stock"; 20 | 21 | // Website location 22 | self.url = @"http://finance.sina.com.cn/realstock/"; 23 | 24 | // Immediately rebquest first update 25 | [self requestUpdate]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | // Override Ticker setter to trigger status item update 32 | - (void)setTicker:(NSString *)tickerString 33 | { 34 | // Update the ticker value 35 | _ticker = tickerString; 36 | 37 | // Trigger notification to update ticker 38 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 39 | } 40 | 41 | // Initiates an asyncronous HTTP connection 42 | - (void)requestUpdate 43 | { 44 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://apistore.baidu.com/microservice/stock?stockid=000001"]]; 45 | 46 | // Set the request's user agent 47 | [request addValue:@"bitbar/4.0 (OkcoinCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 48 | 49 | // Initialize a connection from our request 50 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 51 | 52 | // Go go go 53 | [connection start]; 54 | } 55 | 56 | // Initializes data storage on request response 57 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 58 | { 59 | self.responseData = [[NSMutableData alloc] init]; 60 | } 61 | 62 | // Appends response data 63 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 64 | { 65 | [self.responseData appendData:data]; 66 | } 67 | 68 | // Indiciate no caching 69 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 70 | { 71 | return nil; 72 | } 73 | 74 | // Parse data after load 75 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 76 | { 77 | // Parse the JSON into results 78 | NSError *jsonParsingError = nil; 79 | NSDictionary *results = [[NSDictionary alloc] init]; 80 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 81 | 82 | // Results parsed successfully from JSON 83 | if(results) 84 | { 85 | // Get API status 86 | NSString *errMsg = [results objectForKey:@"errMsg"]; 87 | NSLog(errMsg,nil); 88 | 89 | NSString *shanghai=[[[[results objectForKey:@"retData"]objectForKey:@"market"] objectForKey:@"shanghai"]objectForKey:@"curdot"]; 90 | NSString *shenzhen=[[[[results objectForKey:@"retData"]objectForKey:@"market"] objectForKey:@"shenzhen"]objectForKey:@"curdot"]; 91 | 92 | // If API call succeeded update the ticker... 93 | if(shanghai) 94 | { 95 | NSString *shanghaistring = [NSString stringWithFormat:@"ShangHai: %@",shanghai]; 96 | NSString *shenzhenstring = [NSString stringWithFormat:@" ShenZhen: %@",shenzhen]; 97 | 98 | NSString *resultsStatus = [shanghaistring stringByAppendingString:shenzhenstring]; 99 | 100 | //NSLog(resultsStatus,nil); 101 | 102 | self.ticker = resultsStatus; 103 | } 104 | // Otherwise log an error... 105 | else 106 | { 107 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 108 | self.ticker = nil; 109 | } 110 | } 111 | // JSON parsing failed 112 | else 113 | { 114 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 115 | self.ticker = nil; 116 | } 117 | } 118 | 119 | // HTTP request failed 120 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 121 | { 122 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to BitStamp.", NSLocalizedFailureReasonErrorKey, nil]]; 123 | self.ticker = nil; 124 | } 125 | 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /bitbar/Fetchers/HaobtcInstantCNYFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.m 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import "HaobtcInstantCNYFetcher.h" 10 | 11 | @implementation HaobtcInstantCNYFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"Haobtc Benchmark"; 19 | 20 | // Website location 21 | self.url = @"https://haobtc.com/?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://haobtc.com/api/v1/price/cny"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (HaobtcCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | NSString *responseStr = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; 77 | if (!responseStr) { 78 | return; 79 | } 80 | 81 | // Parse the JSON into results 82 | NSError *jsonParsingError = nil; 83 | id results = [NSJSONSerialization JSONObjectWithData:[responseStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&jsonParsingError]; 84 | 85 | // Results parsed successfully from JSON 86 | if (results) 87 | { 88 | NSString *sell_price = [results objectForKey:@"buy"]; 89 | NSString *buy_price = [results objectForKey:@"sell"]; 90 | if (sell_price && buy_price) { 91 | // NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; 92 | // NSString *resultsStatus = [numberFormatter stringFromNumber:sell_price]; 93 | // resultsStatus = [NSString stringWithFormat:@"¥%@", resultsStatus]; 94 | // 95 | // self.error = nil; 96 | // self.ticker = resultsStatus; 97 | 98 | NSString *sell_price_str = [NSString stringWithFormat:@"/%@",sell_price]; 99 | NSString *buy_price_str = [NSString stringWithFormat:@"¥%@",buy_price]; 100 | 101 | NSString *resultsStatus = [buy_price_str stringByAppendingString:sell_price_str]; 102 | 103 | NSLog(resultsStatus,nil); 104 | 105 | self.ticker = resultsStatus; 106 | 107 | } 108 | // Otherwise log an error... 109 | else 110 | { 111 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 112 | self.ticker = nil; 113 | } 114 | } 115 | // JSON parsing failed 116 | else 117 | { 118 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 119 | self.ticker = nil; 120 | } 121 | } 122 | 123 | // HTTP request failed 124 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 125 | { 126 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to Haobtc.", NSLocalizedFailureReasonErrorKey, nil]]; 127 | self.ticker = nil; 128 | } 129 | 130 | @end 131 | -------------------------------------------------------------------------------- /bitbar/Fetchers/Btc38.m: -------------------------------------------------------------------------------- 1 | // 2 | // Btc38.m 3 | // btcbar 4 | // 5 | // Created by phil on 15/4/16. 6 | // Copyright (c) 2015年 nearengine. All rights reserved. 7 | // 8 | 9 | #import "Btc38.h" 10 | 11 | @implementation Btc38 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"BTC38"; 19 | 20 | // Website location 21 | self.url = @"http://btc38.com?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://api.btc38.com/v1/ticker.php?c=all&mk_type=cny"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (OkcoinCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | // Parse the JSON into results 77 | NSError *jsonParsingError = nil; 78 | NSDictionary *results = [[NSDictionary alloc] init]; 79 | results = [NSJSONSerialization JSONObjectWithData:self.responseData options:0 error:&jsonParsingError]; 80 | 81 | // Results parsed successfully from JSON 82 | if(results) 83 | { 84 | // Get API status 85 | NSNumber *xrp=[[[results objectForKey:@"xrp"]objectForKey:@"ticker"] objectForKey:@"last"]; 86 | NSNumber *bts=[[[results objectForKey:@"bts"]objectForKey:@"ticker"] objectForKey:@"last"]; 87 | 88 | // If API call succeeded update the ticker... 89 | if(xrp) 90 | { 91 | NSString *xrpstring = [NSString stringWithFormat:@"XRP %lg", [xrp doubleValue]]; 92 | NSString *btsstring = [NSString stringWithFormat:@" BTS %lg",[bts doubleValue]]; 93 | 94 | NSString *resultsStatus = [xrpstring stringByAppendingString:btsstring]; 95 | 96 | NSLog(resultsStatus,nil); 97 | 98 | self.ticker = resultsStatus; 99 | 100 | // NSNumberFormatter *currencyStyle = [[NSNumberFormatter alloc] init]; 101 | // currencyStyle.locale = [[NSLocale alloc] initWithLocaleIdentifier:@"zh_CN"]; 102 | // currencyStyle.numberStyle = NSNumberFormatterCurrencyStyle; 103 | // resultsStatus = [currencyStyle stringFromNumber:[NSDecimalNumber decimalNumberWithString:resultsStatus]]; 104 | // self.ticker = resultsStatus; 105 | } 106 | // Otherwise log an error... 107 | else 108 | { 109 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 110 | self.ticker = nil; 111 | } 112 | } 113 | // JSON parsing failed 114 | else 115 | { 116 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 117 | self.ticker = nil; 118 | } 119 | } 120 | 121 | // HTTP request failed 122 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 123 | { 124 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to BitStamp.", NSLocalizedFailureReasonErrorKey, nil]]; 125 | self.ticker = nil; 126 | } 127 | 128 | @end 129 | 130 | -------------------------------------------------------------------------------- /bitbar/Fetchers/HaobtcCNYFetcher.m: -------------------------------------------------------------------------------- 1 | // 2 | // HuobiCNYFetcher.m 3 | // btcbar 4 | // 5 | // Created by lwei on 2/13/14. 6 | // Copyright (c) 2014 nearengine. All rights reserved. 7 | // 8 | 9 | #import "HaobtcCNYFetcher.h" 10 | 11 | @implementation HaobtcCNYFetcher 12 | 13 | - (id)init 14 | { 15 | if (self = [super init]) 16 | { 17 | // Menu Item Name 18 | self.ticker_menu = @"BixinOTC BTC"; 19 | 20 | // Website location 21 | self.url = @"http://im.bixin.com?from=1NDnnWCUu926z4wxA3sNBGYWNQD3mKyes8"; 22 | 23 | // Immediately request first update 24 | [self requestUpdate]; 25 | } 26 | 27 | return self; 28 | } 29 | 30 | // Override Ticker setter to trigger status item update 31 | - (void)setTicker:(NSString *)tickerString 32 | { 33 | // Update the ticker value 34 | _ticker = tickerString; 35 | 36 | // Trigger notification to update ticker 37 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:self]; 38 | } 39 | 40 | // Initiates an asyncronous HTTP connection 41 | - (void)requestUpdate 42 | { 43 | NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://buysell.haobtc.com/broker/get_ticker"]]; 44 | 45 | // Set the request's user agent 46 | [request addValue:@"bitbar/4.0 (HaobtcCNYFetcher)" forHTTPHeaderField:@"User-Agent"]; 47 | 48 | // Initialize a connection from our request 49 | NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; 50 | 51 | // Go go go 52 | [connection start]; 53 | } 54 | 55 | // Initializes data storage on request response 56 | - (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response 57 | { 58 | self.responseData = [[NSMutableData alloc] init]; 59 | } 60 | 61 | // Appends response data 62 | - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data 63 | { 64 | [self.responseData appendData:data]; 65 | } 66 | 67 | // Indiciate no caching 68 | - (NSCachedURLResponse *)connection:(NSURLConnection *)connection willCacheResponse:(NSCachedURLResponse *)cachedResponse 69 | { 70 | return nil; 71 | } 72 | 73 | // Parse data after load 74 | - (void)connectionDidFinishLoading:(NSURLConnection *)connection 75 | { 76 | NSString *responseStr = [[NSString alloc] initWithData:self.responseData encoding:NSUTF8StringEncoding]; 77 | if (!responseStr) { 78 | return; 79 | } 80 | 81 | // Parse the JSON into results 82 | NSError *jsonParsingError = nil; 83 | id results = [NSJSONSerialization JSONObjectWithData:[responseStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingAllowFragments error:&jsonParsingError]; 84 | 85 | // Results parsed successfully from JSON 86 | if (results) 87 | { 88 | NSDictionary *ticker = [results objectForKey:@"result"]; 89 | 90 | NSString *sell_price = [ticker objectForKey:@"bid"]; 91 | NSString *buy_price = [ticker objectForKey:@"ask"]; 92 | if (sell_price && buy_price) { 93 | // NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init]; 94 | // NSString *resultsStatus = [numberFormatter stringFromNumber:sell_price]; 95 | // resultsStatus = [NSString stringWithFormat:@"¥%@", resultsStatus]; 96 | // 97 | // self.error = nil; 98 | // self.ticker = resultsStatus; 99 | 100 | NSString *sell_price_str = [NSString stringWithFormat:@"/%@",sell_price]; 101 | NSString *buy_price_str = [NSString stringWithFormat:@"¥%@",buy_price]; 102 | 103 | NSString *resultsStatus = [buy_price_str stringByAppendingString:sell_price_str]; 104 | 105 | NSLog(resultsStatus,nil); 106 | 107 | self.ticker = resultsStatus; 108 | 109 | } 110 | // Otherwise log an error... 111 | else 112 | { 113 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"API Error", NSLocalizedDescriptionKey, @"The JSON received did not contain a result or the API returned an error.", NSLocalizedFailureReasonErrorKey, nil]]; 114 | self.ticker = nil; 115 | } 116 | } 117 | // JSON parsing failed 118 | else 119 | { 120 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"JSON Error", NSLocalizedDescriptionKey, @"Could not parse the JSON returned.", NSLocalizedFailureReasonErrorKey, nil]]; 121 | self.ticker = nil; 122 | } 123 | } 124 | 125 | // HTTP request failed 126 | - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 127 | { 128 | self.error = [NSError errorWithDomain:@"com.nearengine.btcbar" code:0 userInfo:[NSDictionary dictionaryWithObjectsAndKeys: @"Connection Error", NSLocalizedDescriptionKey, @"Could not connect to Haobtc.", NSLocalizedFailureReasonErrorKey, nil]]; 129 | self.ticker = nil; 130 | } 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /bitbar/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // btcbar 4 | // 5 | 6 | #import "AppDelegate.h" 7 | 8 | #import "BitStampUSDFetcher.h" 9 | #import "CoinbaseUSDFetcher.h" 10 | #import "BTCeUSDFetcher.h" 11 | #import "BitFinexUSDFetcher.h" 12 | #import "WinkDexUSDFetcher.h" 13 | #import "OKCoinCNYFetcher.h" 14 | #import "HuobiCNYFetcher.h" 15 | #import "Btc38.h" 16 | #import "AstockFetcher.h" 17 | #import "HaobtcCNYFetcher.h" 18 | #import "HaobtcInstantCNYFetcher.h" 19 | 20 | #import "BTCCCNYFetcher.h" 21 | #import "OKCoinFutureUSDFetcher.h" 22 | #import "YunbiEthFetcher.h" 23 | #import "PoloniexEthFetcher.h" 24 | #import "YunbiEtcFetcher.h" 25 | #import "PoloniexEtcFetcher.h" 26 | #import "YunbiEOSFetcher.h" 27 | #import "ViaBCCFetcher.h" 28 | 29 | @implementation AppDelegate 30 | 31 | // 32 | // ENTRY & EXIT 33 | // 34 | 35 | // Status item initialization 36 | - (void)awakeFromNib 37 | { 38 | // Load ticker preference from disk 39 | prefs = [NSUserDefaults standardUserDefaults]; 40 | 41 | // Register update notifications for tickers 42 | [[NSNotificationCenter defaultCenter] 43 | addObserver:self 44 | selector:@selector(handleTickerNotification:) 45 | name:@"btcbar_ticker_update" 46 | object:nil]; 47 | 48 | // Pass each ticker object into a dictionary, get first updates 49 | tickers = [NSMutableArray arrayWithObjects: 50 | // [[HaobtcInstantCNYFetcher alloc] init], 51 | // [[HaobtcCNYFetcher alloc] init], 52 | [[HuobiCNYFetcher alloc] init], 53 | [[OKCoinCNYFetcher alloc] init], 54 | // [[BTCCCNYFetcher alloc] init], 55 | [[OKCoinFutureUSDFetcher alloc] init], 56 | // [[BitFinexUSDFetcher alloc] init], 57 | // [[CoinbaseUSDFetcher alloc] init], 58 | // [[BitStampUSDFetcher alloc] init], 59 | // [[BTCeUSDFetcher alloc] init], 60 | [[YunbiEOSFetcher alloc] init], 61 | [[YunbiEthFetcher alloc] init], 62 | // [[PoloniexEthFetcher alloc] init], 63 | [[YunbiEtcFetcher alloc] init], 64 | [[ViaBCCFetcher alloc] init], 65 | 66 | // [[PoloniexEtcFetcher alloc] init], 67 | // [[WinkDexUSDFetcher alloc] init], 68 | // [[Btc38 alloc] init], 69 | // [[AstockFetcher alloc] init], 70 | nil]; 71 | 72 | 73 | // If ticker preference does not exist, default to 0 74 | if (![prefs integerForKey:@"btcbar_ticker"]) 75 | [prefs setInteger:0 forKey:@"btcbar_ticker"]; 76 | currentFetcherTag = [prefs integerForKey:@"btcbar_ticker"]; 77 | 78 | // If ticker preference exceeds the bounds of `tickers`, default to 0 79 | if (currentFetcherTag < 0 || currentFetcherTag >= [tickers count]) 80 | currentFetcherTag = 0; 81 | 82 | // Initialize main menu 83 | btcbarMainMenu = [[NSMenu alloc] initWithTitle:@"loading..."]; 84 | 85 | // Add each loaded ticker object to main menu 86 | for(id ticker in tickers) 87 | { 88 | NSMenuItem *new_menuitem = [[NSMenuItem alloc] initWithTitle:[ticker ticker_menu] action:@selector(menuActionSetTicker:) keyEquivalent:@""]; 89 | new_menuitem.tag = [tickers indexOfObject:ticker]; 90 | [btcbarMainMenu addItem:new_menuitem]; 91 | } 92 | 93 | // Add the separator, Open in Browser, and Quit items to main menu 94 | [btcbarMainMenu addItem:[NSMenuItem separatorItem]]; 95 | // [btcbarMainMenu addItem:[[NSMenuItem alloc] initWithTitle:@"Trade" action:@selector(menuActionBrowser:) keyEquivalent:@"o"]]; 96 | [btcbarMainMenu addItem:[[NSMenuItem alloc] initWithTitle:@"About" action:@selector(menuActionAbout:) keyEquivalent:@"a"]]; 97 | [btcbarMainMenu addItem:[[NSMenuItem alloc] initWithTitle:@"Quit" action:@selector(menuActionQuit:) keyEquivalent:@"q"]]; 98 | 99 | // Set the default ticker's menu item state to checked 100 | [[btcbarMainMenu.itemArray objectAtIndex:currentFetcherTag] setState:NSOnState]; 101 | 102 | // Initialize status bar item with flexible width 103 | btcbarStatusItem = [[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength]; 104 | 105 | // Set status bar image 106 | NSImage *image = [NSImage imageNamed:@"btclogo"]; 107 | [image setTemplate:YES]; 108 | [btcbarStatusItem setImage:image]; 109 | 110 | // Set menu options on click 111 | btcbarStatusItem.menu = btcbarMainMenu; 112 | 113 | // Setup timer to update all tickers every 10 seconds 114 | updateDataTimer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(updateDataTimerAction:) userInfo:nil repeats:YES]; 115 | } 116 | 117 | 118 | // 119 | // MENUITEM ACTIONS 120 | // 121 | 122 | // Action for menu items which change current ticker 123 | - (void)menuActionSetTicker:(id)sender 124 | { 125 | // Set all menu items to "off" state 126 | for (NSMenuItem *menuitem in btcbarMainMenu.itemArray) 127 | menuitem.state = NSOffState; 128 | 129 | // Set this menu item to "on" state 130 | [sender setState:NSOnState]; 131 | 132 | // Update ticker preference 133 | currentFetcherTag = [sender tag]; 134 | [prefs setInteger:currentFetcherTag forKey:@"btcbar_ticker"]; 135 | [prefs synchronize]; 136 | 137 | // Update the requested ticker immediately 138 | [[tickers objectAtIndex:currentFetcherTag] requestUpdate]; 139 | 140 | // Force the status item value to update 141 | [[NSNotificationCenter defaultCenter] postNotificationName:@"btcbar_ticker_update" object:[tickers objectAtIndex:currentFetcherTag]]; 142 | 143 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[(id )[tickers objectAtIndex:currentFetcherTag] url]]]; 144 | } 145 | 146 | // "Open in Browser" action 147 | - (void)menuActionBrowser:(id)sender 148 | { 149 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[(id )[tickers objectAtIndex:currentFetcherTag] url]]]; 150 | } 151 | 152 | 153 | 154 | // "Quit" action 155 | - (void)menuActionQuit:(id)sender 156 | { 157 | [NSApp performSelector:@selector(terminate:) withObject:nil afterDelay:0.0]; 158 | } 159 | 160 | 161 | // 162 | // CALLBACKS 163 | // 164 | 165 | // Handles Fetcher completion notifications 166 | -(void)handleTickerNotification:(NSNotification *)pNotification 167 | { 168 | if ([[pNotification object] ticker] != nil) 169 | { 170 | // Set the menu item of the notifying Fetcher to its latest ticker value 171 | [[[btcbarMainMenu itemArray] objectAtIndex:[tickers indexOfObject:[pNotification object]]] setTitle:[NSString stringWithFormat:@"[%@] %@",[[pNotification object] ticker], [[pNotification object] ticker_menu]]]; 172 | } 173 | else 174 | { 175 | // Set the ticker value in the menu to the short error 176 | [[[btcbarMainMenu itemArray] objectAtIndex:[tickers indexOfObject:[pNotification object]]] setTitle:[NSString stringWithFormat:@"[%@] %@",[[pNotification object] error].localizedDescription, [[pNotification object] ticker_menu]]]; 177 | } 178 | 179 | // If this notification is for the currently selected ticker, update the status item too 180 | if ([pNotification object] == [tickers objectAtIndex:currentFetcherTag]) 181 | { 182 | if ([[pNotification object] ticker] == nil) 183 | { 184 | btcbarStatusItem.title = nil; 185 | btcbarStatusItem.toolTip = [NSString stringWithFormat: @"%@ Error: %@", [[pNotification object] ticker_menu], [[pNotification object] error].localizedFailureReason]; 186 | } 187 | else 188 | { 189 | // Set the status item to the current Fetcher's ticker 190 | btcbarStatusItem.title = [(id )[tickers objectAtIndex:currentFetcherTag] ticker]; 191 | btcbarStatusItem.toolTip = [[tickers objectAtIndex:currentFetcherTag] ticker_menu]; 192 | } 193 | } 194 | 195 | } 196 | 197 | // Requests for each Fetcher to update itself 198 | - (void)updateDataTimerAction:(NSTimer *)timer 199 | { 200 | for (id ticker in tickers) 201 | [ticker requestUpdate]; 202 | } 203 | 204 | #define kWebAddress @"BitBar is an open source project: \nhttps://github.com/philsong/btcbar/ \n\nBase on \nhttps://github.com/nearengine/btcbar \n" 205 | 206 | - (IBAction)menuActionAbout:(id)sender { 207 | NSAlert *alert = [NSAlert alertWithMessageText:@"About." 208 | defaultButton:@"Open Site" 209 | alternateButton:@"Cancel" 210 | otherButton:@"" 211 | informativeTextWithFormat:kWebAddress]; 212 | 213 | long button = [alert runModal]; 214 | 215 | NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; 216 | switch (button) { 217 | case NSAlertOtherReturn: 218 | NSLog(@"copy"); 219 | [pasteboard clearContents]; 220 | [pasteboard writeObjects:[NSArray arrayWithObject:kWebAddress]]; 221 | break; 222 | case NSAlertDefaultReturn: 223 | { 224 | NSLog(@"Don't copy"); 225 | NSString* url=@"https://github.com/philsong/btcbar/"; 226 | [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:url]]; 227 | break; 228 | } 229 | case NSAlertAlternateReturn: 230 | break; 231 | 232 | default: 233 | break; 234 | } 235 | } 236 | 237 | @end 238 | -------------------------------------------------------------------------------- /bitbar.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 4A2F00551BCF40EA0069E7DC /* HaobtcCNYFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A2F00531BCF40EA0069E7DC /* HaobtcCNYFetcher.m */; }; 11 | 4A598AB81CC4826C0037DAF2 /* PoloniexEthFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A598AB51CC4826C0037DAF2 /* PoloniexEthFetcher.m */; }; 12 | 4A598AB91CC4826C0037DAF2 /* YunbiEthFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A598AB71CC4826C0037DAF2 /* YunbiEthFetcher.m */; }; 13 | 4A5F94F01B0C54A00077BEBF /* BitFinexUSDFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5F94EB1B0C54A00077BEBF /* BitFinexUSDFetcher.m */; }; 14 | 4A5F94F11B0C54A00077BEBF /* HuobiCNYFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5F94ED1B0C54A00077BEBF /* HuobiCNYFetcher.m */; }; 15 | 4A5F94F21B0C54A00077BEBF /* WinkDexUSDFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5F94EF1B0C54A00077BEBF /* WinkDexUSDFetcher.m */; }; 16 | 4A5F94F51B0C56DA0077BEBF /* OKCoinCNYFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5F94F31B0C56DA0077BEBF /* OKCoinCNYFetcher.m */; }; 17 | 4A93AA441D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A93AA431D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.m */; }; 18 | 4AD368D91F44007B0076A513 /* ViaBCCFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AD368D81F44007B0076A513 /* ViaBCCFetcher.m */; }; 19 | 4AE253D91BDF8973002B8FDD /* BTCCCNYFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AE253D71BDF8973002B8FDD /* BTCCCNYFetcher.m */; }; 20 | 4AE253DC1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AE253DA1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.m */; }; 21 | 4AEFB3E11AE0C48D00D6BE3A /* AstockFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AEFB3DC1AE0C48D00D6BE3A /* AstockFetcher.m */; }; 22 | 4AEFB3E21AE0C48D00D6BE3A /* Btc38.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AEFB3DE1AE0C48D00D6BE3A /* Btc38.m */; }; 23 | 4AFCE09A1D51C8D000D8032E /* PoloniexEtcFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AFCE0971D51C8D000D8032E /* PoloniexEtcFetcher.m */; }; 24 | 4AFCE09B1D51C8D000D8032E /* YunbiEtcFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AFCE0991D51C8D000D8032E /* YunbiEtcFetcher.m */; }; 25 | 830CE091171B6C3E00DDD525 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 830CE090171B6C3E00DDD525 /* Cocoa.framework */; }; 26 | 830CE09B171B6C3E00DDD525 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 830CE099171B6C3E00DDD525 /* InfoPlist.strings */; }; 27 | 830CE09D171B6C3E00DDD525 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 830CE09C171B6C3E00DDD525 /* main.m */; }; 28 | 830CE0A4171B6C3E00DDD525 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 830CE0A3171B6C3E00DDD525 /* AppDelegate.m */; }; 29 | 83C3E7491859700100FA2921 /* BitStampUSDFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C3E7421859700100FA2921 /* BitStampUSDFetcher.m */; }; 30 | 83C3E74A1859700100FA2921 /* BTCeUSDFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C3E7441859700100FA2921 /* BTCeUSDFetcher.m */; }; 31 | 83C3E74B1859700100FA2921 /* CoinbaseUSDFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 83C3E7461859700100FA2921 /* CoinbaseUSDFetcher.m */; }; 32 | 83C3E74F1859702000FA2921 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 83C3E74E1859702000FA2921 /* MainMenu.xib */; }; 33 | 83C3E7541859702D00FA2921 /* btclogo.png in Resources */ = {isa = PBXBuildFile; fileRef = 83C3E7501859702D00FA2921 /* btclogo.png */; }; 34 | 83C3E759185970C800FA2921 /* Icon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 83C3E758185970C800FA2921 /* Icon.icns */; }; 35 | 8490B1E71F0E0FAC00F19DCD /* YunbiEOSFetcher.m in Sources */ = {isa = PBXBuildFile; fileRef = 8490B1E61F0E0FAC00F19DCD /* YunbiEOSFetcher.m */; }; 36 | /* End PBXBuildFile section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 4A2F00531BCF40EA0069E7DC /* HaobtcCNYFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HaobtcCNYFetcher.m; path = Fetchers/HaobtcCNYFetcher.m; sourceTree = ""; }; 40 | 4A2F00561BCF41500069E7DC /* HaobtcCNYFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HaobtcCNYFetcher.h; path = Fetchers/HaobtcCNYFetcher.h; sourceTree = ""; }; 41 | 4A598AB41CC4826C0037DAF2 /* PoloniexEthFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PoloniexEthFetcher.h; path = Fetchers/PoloniexEthFetcher.h; sourceTree = ""; }; 42 | 4A598AB51CC4826C0037DAF2 /* PoloniexEthFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PoloniexEthFetcher.m; path = Fetchers/PoloniexEthFetcher.m; sourceTree = ""; }; 43 | 4A598AB61CC4826C0037DAF2 /* YunbiEthFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YunbiEthFetcher.h; path = Fetchers/YunbiEthFetcher.h; sourceTree = ""; }; 44 | 4A598AB71CC4826C0037DAF2 /* YunbiEthFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = YunbiEthFetcher.m; path = Fetchers/YunbiEthFetcher.m; sourceTree = ""; }; 45 | 4A5F94EA1B0C54A00077BEBF /* BitFinexUSDFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BitFinexUSDFetcher.h; path = Fetchers/BitFinexUSDFetcher.h; sourceTree = ""; }; 46 | 4A5F94EB1B0C54A00077BEBF /* BitFinexUSDFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BitFinexUSDFetcher.m; path = Fetchers/BitFinexUSDFetcher.m; sourceTree = ""; }; 47 | 4A5F94EC1B0C54A00077BEBF /* HuobiCNYFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HuobiCNYFetcher.h; path = Fetchers/HuobiCNYFetcher.h; sourceTree = ""; }; 48 | 4A5F94ED1B0C54A00077BEBF /* HuobiCNYFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HuobiCNYFetcher.m; path = Fetchers/HuobiCNYFetcher.m; sourceTree = ""; }; 49 | 4A5F94EE1B0C54A00077BEBF /* WinkDexUSDFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WinkDexUSDFetcher.h; path = Fetchers/WinkDexUSDFetcher.h; sourceTree = ""; }; 50 | 4A5F94EF1B0C54A00077BEBF /* WinkDexUSDFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WinkDexUSDFetcher.m; path = Fetchers/WinkDexUSDFetcher.m; sourceTree = ""; }; 51 | 4A5F94F31B0C56DA0077BEBF /* OKCoinCNYFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OKCoinCNYFetcher.m; path = Fetchers/OKCoinCNYFetcher.m; sourceTree = ""; }; 52 | 4A5F94F41B0C56DA0077BEBF /* OKCoinCNYFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OKCoinCNYFetcher.h; path = Fetchers/OKCoinCNYFetcher.h; sourceTree = ""; }; 53 | 4A93AA421D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HaobtcInstantCNYFetcher.h; path = Fetchers/HaobtcInstantCNYFetcher.h; sourceTree = ""; }; 54 | 4A93AA431D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = HaobtcInstantCNYFetcher.m; path = Fetchers/HaobtcInstantCNYFetcher.m; sourceTree = ""; }; 55 | 4AD368D71F44007B0076A513 /* ViaBCCFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViaBCCFetcher.h; path = Fetchers/ViaBCCFetcher.h; sourceTree = ""; }; 56 | 4AD368D81F44007B0076A513 /* ViaBCCFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ViaBCCFetcher.m; path = Fetchers/ViaBCCFetcher.m; sourceTree = ""; }; 57 | 4AE253D71BDF8973002B8FDD /* BTCCCNYFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BTCCCNYFetcher.m; path = Fetchers/BTCCCNYFetcher.m; sourceTree = ""; }; 58 | 4AE253D81BDF8973002B8FDD /* BTCCCNYFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BTCCCNYFetcher.h; path = Fetchers/BTCCCNYFetcher.h; sourceTree = ""; }; 59 | 4AE253DA1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OKCoinFutureUSDFetcher.m; path = Fetchers/OKCoinFutureUSDFetcher.m; sourceTree = ""; }; 60 | 4AE253DB1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OKCoinFutureUSDFetcher.h; path = Fetchers/OKCoinFutureUSDFetcher.h; sourceTree = ""; }; 61 | 4AEFB3DA1AE0ADA800D6BE3A /* bitbar.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = bitbar.entitlements; sourceTree = ""; }; 62 | 4AEFB3DB1AE0C48D00D6BE3A /* AstockFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AstockFetcher.h; path = Fetchers/AstockFetcher.h; sourceTree = ""; }; 63 | 4AEFB3DC1AE0C48D00D6BE3A /* AstockFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AstockFetcher.m; path = Fetchers/AstockFetcher.m; sourceTree = ""; }; 64 | 4AEFB3DD1AE0C48D00D6BE3A /* Btc38.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Btc38.h; path = Fetchers/Btc38.h; sourceTree = ""; }; 65 | 4AEFB3DE1AE0C48D00D6BE3A /* Btc38.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Btc38.m; path = Fetchers/Btc38.m; sourceTree = ""; }; 66 | 4AFCE0961D51C8D000D8032E /* PoloniexEtcFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PoloniexEtcFetcher.h; path = Fetchers/PoloniexEtcFetcher.h; sourceTree = ""; }; 67 | 4AFCE0971D51C8D000D8032E /* PoloniexEtcFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PoloniexEtcFetcher.m; path = Fetchers/PoloniexEtcFetcher.m; sourceTree = ""; }; 68 | 4AFCE0981D51C8D000D8032E /* YunbiEtcFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YunbiEtcFetcher.h; path = Fetchers/YunbiEtcFetcher.h; sourceTree = ""; }; 69 | 4AFCE0991D51C8D000D8032E /* YunbiEtcFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = YunbiEtcFetcher.m; path = Fetchers/YunbiEtcFetcher.m; sourceTree = ""; }; 70 | 830CE08D171B6C3E00DDD525 /* bitbar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = bitbar.app; sourceTree = BUILT_PRODUCTS_DIR; }; 71 | 830CE090171B6C3E00DDD525 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 72 | 830CE093171B6C3E00DDD525 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 73 | 830CE094171B6C3E00DDD525 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 74 | 830CE095171B6C3E00DDD525 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 75 | 830CE098171B6C3E00DDD525 /* bitbar-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "bitbar-Info.plist"; sourceTree = ""; }; 76 | 830CE09A171B6C3E00DDD525 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 77 | 830CE09C171B6C3E00DDD525 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 78 | 830CE09E171B6C3E00DDD525 /* bitbar-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "bitbar-Prefix.pch"; sourceTree = ""; }; 79 | 830CE0A2171B6C3E00DDD525 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 80 | 830CE0A3171B6C3E00DDD525 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 81 | 830CE0AE171B6C3F00DDD525 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; }; 82 | 838F4296182E2F6E00B4FC58 /* Fetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fetcher.h; sourceTree = ""; }; 83 | 83C3E7411859700100FA2921 /* BitStampUSDFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BitStampUSDFetcher.h; path = Fetchers/BitStampUSDFetcher.h; sourceTree = ""; }; 84 | 83C3E7421859700100FA2921 /* BitStampUSDFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BitStampUSDFetcher.m; path = Fetchers/BitStampUSDFetcher.m; sourceTree = ""; }; 85 | 83C3E7431859700100FA2921 /* BTCeUSDFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BTCeUSDFetcher.h; path = Fetchers/BTCeUSDFetcher.h; sourceTree = ""; }; 86 | 83C3E7441859700100FA2921 /* BTCeUSDFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = BTCeUSDFetcher.m; path = Fetchers/BTCeUSDFetcher.m; sourceTree = ""; }; 87 | 83C3E7451859700100FA2921 /* CoinbaseUSDFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CoinbaseUSDFetcher.h; path = Fetchers/CoinbaseUSDFetcher.h; sourceTree = ""; }; 88 | 83C3E7461859700100FA2921 /* CoinbaseUSDFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CoinbaseUSDFetcher.m; path = Fetchers/CoinbaseUSDFetcher.m; sourceTree = ""; }; 89 | 83C3E74E1859702000FA2921 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; name = MainMenu.xib; path = Views/MainMenu.xib; sourceTree = ""; }; 90 | 83C3E7501859702D00FA2921 /* btclogo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = btclogo.png; path = Icons/btclogo.png; sourceTree = ""; }; 91 | 83C3E758185970C800FA2921 /* Icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = Icon.icns; path = ../Resources/Icon.icns; sourceTree = ""; }; 92 | 8490B1E51F0E0FAC00F19DCD /* YunbiEOSFetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = YunbiEOSFetcher.h; path = Fetchers/YunbiEOSFetcher.h; sourceTree = ""; }; 93 | 8490B1E61F0E0FAC00F19DCD /* YunbiEOSFetcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = YunbiEOSFetcher.m; path = Fetchers/YunbiEOSFetcher.m; sourceTree = ""; }; 94 | /* End PBXFileReference section */ 95 | 96 | /* Begin PBXFrameworksBuildPhase section */ 97 | 830CE08A171B6C3E00DDD525 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | 830CE091171B6C3E00DDD525 /* Cocoa.framework in Frameworks */, 102 | ); 103 | runOnlyForDeploymentPostprocessing = 0; 104 | }; 105 | /* End PBXFrameworksBuildPhase section */ 106 | 107 | /* Begin PBXGroup section */ 108 | 830CE084171B6C3E00DDD525 = { 109 | isa = PBXGroup; 110 | children = ( 111 | 830CE096171B6C3E00DDD525 /* bitbar */, 112 | 830CE08F171B6C3E00DDD525 /* Frameworks */, 113 | 830CE08E171B6C3E00DDD525 /* Products */, 114 | ); 115 | sourceTree = ""; 116 | }; 117 | 830CE08E171B6C3E00DDD525 /* Products */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 830CE08D171B6C3E00DDD525 /* bitbar.app */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 830CE08F171B6C3E00DDD525 /* Frameworks */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 830CE090171B6C3E00DDD525 /* Cocoa.framework */, 129 | 830CE0AE171B6C3F00DDD525 /* SenTestingKit.framework */, 130 | 830CE092171B6C3E00DDD525 /* Other Frameworks */, 131 | ); 132 | name = Frameworks; 133 | sourceTree = ""; 134 | }; 135 | 830CE092171B6C3E00DDD525 /* Other Frameworks */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | 830CE093171B6C3E00DDD525 /* AppKit.framework */, 139 | 830CE094171B6C3E00DDD525 /* CoreData.framework */, 140 | 830CE095171B6C3E00DDD525 /* Foundation.framework */, 141 | ); 142 | name = "Other Frameworks"; 143 | sourceTree = ""; 144 | }; 145 | 830CE096171B6C3E00DDD525 /* bitbar */ = { 146 | isa = PBXGroup; 147 | children = ( 148 | 4AEFB3DA1AE0ADA800D6BE3A /* bitbar.entitlements */, 149 | 830CE0A2171B6C3E00DDD525 /* AppDelegate.h */, 150 | 830CE0A3171B6C3E00DDD525 /* AppDelegate.m */, 151 | 838F4296182E2F6E00B4FC58 /* Fetcher.h */, 152 | 838F4297182E5A5000B4FC58 /* Fetchers */, 153 | 830CE0C4171B714E00DDD525 /* Icons */, 154 | 83C3E74D1859701400FA2921 /* Views */, 155 | 830CE097171B6C3E00DDD525 /* Supporting Files */, 156 | ); 157 | path = bitbar; 158 | sourceTree = ""; 159 | }; 160 | 830CE097171B6C3E00DDD525 /* Supporting Files */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | 830CE098171B6C3E00DDD525 /* bitbar-Info.plist */, 164 | 830CE099171B6C3E00DDD525 /* InfoPlist.strings */, 165 | 830CE09C171B6C3E00DDD525 /* main.m */, 166 | 830CE09E171B6C3E00DDD525 /* bitbar-Prefix.pch */, 167 | ); 168 | name = "Supporting Files"; 169 | sourceTree = ""; 170 | }; 171 | 830CE0C4171B714E00DDD525 /* Icons */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 83C3E758185970C800FA2921 /* Icon.icns */, 175 | 83C3E7501859702D00FA2921 /* btclogo.png */, 176 | ); 177 | name = Icons; 178 | sourceTree = ""; 179 | }; 180 | 838F4297182E5A5000B4FC58 /* Fetchers */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | 4AD368D71F44007B0076A513 /* ViaBCCFetcher.h */, 184 | 4AD368D81F44007B0076A513 /* ViaBCCFetcher.m */, 185 | 8490B1E51F0E0FAC00F19DCD /* YunbiEOSFetcher.h */, 186 | 8490B1E61F0E0FAC00F19DCD /* YunbiEOSFetcher.m */, 187 | 4AFCE0961D51C8D000D8032E /* PoloniexEtcFetcher.h */, 188 | 4AFCE0971D51C8D000D8032E /* PoloniexEtcFetcher.m */, 189 | 4AFCE0981D51C8D000D8032E /* YunbiEtcFetcher.h */, 190 | 4AFCE0991D51C8D000D8032E /* YunbiEtcFetcher.m */, 191 | 4A93AA421D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.h */, 192 | 4A93AA431D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.m */, 193 | 4A598AB41CC4826C0037DAF2 /* PoloniexEthFetcher.h */, 194 | 4A598AB51CC4826C0037DAF2 /* PoloniexEthFetcher.m */, 195 | 4A598AB61CC4826C0037DAF2 /* YunbiEthFetcher.h */, 196 | 4A598AB71CC4826C0037DAF2 /* YunbiEthFetcher.m */, 197 | 4AE253DA1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.m */, 198 | 4AE253DB1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.h */, 199 | 4AE253D71BDF8973002B8FDD /* BTCCCNYFetcher.m */, 200 | 4AE253D81BDF8973002B8FDD /* BTCCCNYFetcher.h */, 201 | 4A2F00531BCF40EA0069E7DC /* HaobtcCNYFetcher.m */, 202 | 4A2F00561BCF41500069E7DC /* HaobtcCNYFetcher.h */, 203 | 4A5F94F31B0C56DA0077BEBF /* OKCoinCNYFetcher.m */, 204 | 4A5F94F41B0C56DA0077BEBF /* OKCoinCNYFetcher.h */, 205 | 4A5F94EA1B0C54A00077BEBF /* BitFinexUSDFetcher.h */, 206 | 4A5F94EB1B0C54A00077BEBF /* BitFinexUSDFetcher.m */, 207 | 4A5F94EC1B0C54A00077BEBF /* HuobiCNYFetcher.h */, 208 | 4A5F94ED1B0C54A00077BEBF /* HuobiCNYFetcher.m */, 209 | 4A5F94EE1B0C54A00077BEBF /* WinkDexUSDFetcher.h */, 210 | 4A5F94EF1B0C54A00077BEBF /* WinkDexUSDFetcher.m */, 211 | 83C3E7411859700100FA2921 /* BitStampUSDFetcher.h */, 212 | 83C3E7421859700100FA2921 /* BitStampUSDFetcher.m */, 213 | 83C3E7431859700100FA2921 /* BTCeUSDFetcher.h */, 214 | 83C3E7441859700100FA2921 /* BTCeUSDFetcher.m */, 215 | 83C3E7451859700100FA2921 /* CoinbaseUSDFetcher.h */, 216 | 83C3E7461859700100FA2921 /* CoinbaseUSDFetcher.m */, 217 | 4AEFB3DB1AE0C48D00D6BE3A /* AstockFetcher.h */, 218 | 4AEFB3DC1AE0C48D00D6BE3A /* AstockFetcher.m */, 219 | 4AEFB3DD1AE0C48D00D6BE3A /* Btc38.h */, 220 | 4AEFB3DE1AE0C48D00D6BE3A /* Btc38.m */, 221 | ); 222 | name = Fetchers; 223 | sourceTree = ""; 224 | }; 225 | 83C3E74D1859701400FA2921 /* Views */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 83C3E74E1859702000FA2921 /* MainMenu.xib */, 229 | ); 230 | name = Views; 231 | sourceTree = ""; 232 | }; 233 | /* End PBXGroup section */ 234 | 235 | /* Begin PBXNativeTarget section */ 236 | 830CE08C171B6C3E00DDD525 /* bitbar */ = { 237 | isa = PBXNativeTarget; 238 | buildConfigurationList = 830CE0BE171B6C3F00DDD525 /* Build configuration list for PBXNativeTarget "bitbar" */; 239 | buildPhases = ( 240 | 830CE089171B6C3E00DDD525 /* Sources */, 241 | 830CE08A171B6C3E00DDD525 /* Frameworks */, 242 | 830CE08B171B6C3E00DDD525 /* Resources */, 243 | ); 244 | buildRules = ( 245 | ); 246 | dependencies = ( 247 | ); 248 | name = bitbar; 249 | productName = bitbar; 250 | productReference = 830CE08D171B6C3E00DDD525 /* bitbar.app */; 251 | productType = "com.apple.product-type.application"; 252 | }; 253 | /* End PBXNativeTarget section */ 254 | 255 | /* Begin PBXProject section */ 256 | 830CE085171B6C3E00DDD525 /* Project object */ = { 257 | isa = PBXProject; 258 | attributes = { 259 | LastUpgradeCheck = 0720; 260 | ORGANIZATIONNAME = bocai; 261 | TargetAttributes = { 262 | 830CE08C171B6C3E00DDD525 = { 263 | DevelopmentTeam = E9EW4P4JNL; 264 | SystemCapabilities = { 265 | com.apple.Sandbox = { 266 | enabled = 1; 267 | }; 268 | }; 269 | }; 270 | }; 271 | }; 272 | buildConfigurationList = 830CE088171B6C3E00DDD525 /* Build configuration list for PBXProject "bitbar" */; 273 | compatibilityVersion = "Xcode 3.2"; 274 | developmentRegion = English; 275 | hasScannedForEncodings = 0; 276 | knownRegions = ( 277 | en, 278 | ); 279 | mainGroup = 830CE084171B6C3E00DDD525; 280 | productRefGroup = 830CE08E171B6C3E00DDD525 /* Products */; 281 | projectDirPath = ""; 282 | projectRoot = ""; 283 | targets = ( 284 | 830CE08C171B6C3E00DDD525 /* bitbar */, 285 | ); 286 | }; 287 | /* End PBXProject section */ 288 | 289 | /* Begin PBXResourcesBuildPhase section */ 290 | 830CE08B171B6C3E00DDD525 /* Resources */ = { 291 | isa = PBXResourcesBuildPhase; 292 | buildActionMask = 2147483647; 293 | files = ( 294 | 83C3E7541859702D00FA2921 /* btclogo.png in Resources */, 295 | 830CE09B171B6C3E00DDD525 /* InfoPlist.strings in Resources */, 296 | 83C3E759185970C800FA2921 /* Icon.icns in Resources */, 297 | 83C3E74F1859702000FA2921 /* MainMenu.xib in Resources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXResourcesBuildPhase section */ 302 | 303 | /* Begin PBXSourcesBuildPhase section */ 304 | 830CE089171B6C3E00DDD525 /* Sources */ = { 305 | isa = PBXSourcesBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | 4AFCE09A1D51C8D000D8032E /* PoloniexEtcFetcher.m in Sources */, 309 | 4AEFB3E11AE0C48D00D6BE3A /* AstockFetcher.m in Sources */, 310 | 4AEFB3E21AE0C48D00D6BE3A /* Btc38.m in Sources */, 311 | 83C3E7491859700100FA2921 /* BitStampUSDFetcher.m in Sources */, 312 | 4AE253D91BDF8973002B8FDD /* BTCCCNYFetcher.m in Sources */, 313 | 4A5F94F11B0C54A00077BEBF /* HuobiCNYFetcher.m in Sources */, 314 | 4A93AA441D000A3B00A7C6E4 /* HaobtcInstantCNYFetcher.m in Sources */, 315 | 8490B1E71F0E0FAC00F19DCD /* YunbiEOSFetcher.m in Sources */, 316 | 4AFCE09B1D51C8D000D8032E /* YunbiEtcFetcher.m in Sources */, 317 | 4A598AB91CC4826C0037DAF2 /* YunbiEthFetcher.m in Sources */, 318 | 4A5F94F01B0C54A00077BEBF /* BitFinexUSDFetcher.m in Sources */, 319 | 830CE09D171B6C3E00DDD525 /* main.m in Sources */, 320 | 83C3E74B1859700100FA2921 /* CoinbaseUSDFetcher.m in Sources */, 321 | 4AE253DC1BDF8AED002B8FDD /* OKCoinFutureUSDFetcher.m in Sources */, 322 | 4A5F94F51B0C56DA0077BEBF /* OKCoinCNYFetcher.m in Sources */, 323 | 83C3E74A1859700100FA2921 /* BTCeUSDFetcher.m in Sources */, 324 | 4A2F00551BCF40EA0069E7DC /* HaobtcCNYFetcher.m in Sources */, 325 | 4A5F94F21B0C54A00077BEBF /* WinkDexUSDFetcher.m in Sources */, 326 | 4A598AB81CC4826C0037DAF2 /* PoloniexEthFetcher.m in Sources */, 327 | 830CE0A4171B6C3E00DDD525 /* AppDelegate.m in Sources */, 328 | 4AD368D91F44007B0076A513 /* ViaBCCFetcher.m in Sources */, 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | /* End PBXSourcesBuildPhase section */ 333 | 334 | /* Begin PBXVariantGroup section */ 335 | 830CE099171B6C3E00DDD525 /* InfoPlist.strings */ = { 336 | isa = PBXVariantGroup; 337 | children = ( 338 | 830CE09A171B6C3E00DDD525 /* en */, 339 | ); 340 | name = InfoPlist.strings; 341 | sourceTree = ""; 342 | }; 343 | /* End PBXVariantGroup section */ 344 | 345 | /* Begin XCBuildConfiguration section */ 346 | 830CE0BC171B6C3F00DDD525 /* Debug */ = { 347 | isa = XCBuildConfiguration; 348 | buildSettings = { 349 | ALWAYS_SEARCH_USER_PATHS = NO; 350 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 351 | CLANG_CXX_LIBRARY = "libc++"; 352 | CLANG_ENABLE_OBJC_ARC = YES; 353 | CLANG_WARN_CONSTANT_CONVERSION = YES; 354 | CLANG_WARN_EMPTY_BODY = YES; 355 | CLANG_WARN_ENUM_CONVERSION = YES; 356 | CLANG_WARN_INT_CONVERSION = YES; 357 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 358 | COPY_PHASE_STRIP = NO; 359 | ENABLE_TESTABILITY = YES; 360 | GCC_C_LANGUAGE_STANDARD = gnu99; 361 | GCC_DYNAMIC_NO_PIC = NO; 362 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 363 | GCC_OPTIMIZATION_LEVEL = 0; 364 | GCC_PREPROCESSOR_DEFINITIONS = ( 365 | "DEBUG=1", 366 | "$(inherited)", 367 | ); 368 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 369 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 370 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 371 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 372 | GCC_WARN_UNUSED_VARIABLE = YES; 373 | MACOSX_DEPLOYMENT_TARGET = 10.7; 374 | ONLY_ACTIVE_ARCH = YES; 375 | SDKROOT = ""; 376 | }; 377 | name = Debug; 378 | }; 379 | 830CE0BD171B6C3F00DDD525 /* Release */ = { 380 | isa = XCBuildConfiguration; 381 | buildSettings = { 382 | ALWAYS_SEARCH_USER_PATHS = NO; 383 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 384 | CLANG_CXX_LIBRARY = "libc++"; 385 | CLANG_ENABLE_OBJC_ARC = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INT_CONVERSION = YES; 390 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 391 | COPY_PHASE_STRIP = YES; 392 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 393 | GCC_C_LANGUAGE_STANDARD = gnu99; 394 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 396 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 397 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 398 | GCC_WARN_UNUSED_VARIABLE = YES; 399 | MACOSX_DEPLOYMENT_TARGET = 10.7; 400 | SDKROOT = ""; 401 | }; 402 | name = Release; 403 | }; 404 | 830CE0BF171B6C3F00DDD525 /* Debug */ = { 405 | isa = XCBuildConfiguration; 406 | buildSettings = { 407 | CODE_SIGN_ENTITLEMENTS = bitbar/bitbar.entitlements; 408 | COMBINE_HIDPI_IMAGES = YES; 409 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 410 | GCC_PREFIX_HEADER = "bitbar/bitbar-Prefix.pch"; 411 | INFOPLIST_FILE = "bitbar/bitbar-Info.plist"; 412 | MACOSX_DEPLOYMENT_TARGET = 10.7; 413 | PRODUCT_BUNDLE_IDENTIFIER = com.philsong.bitbar; 414 | PRODUCT_NAME = "$(TARGET_NAME)"; 415 | WRAPPER_EXTENSION = app; 416 | }; 417 | name = Debug; 418 | }; 419 | 830CE0C0171B6C3F00DDD525 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | CODE_SIGN_ENTITLEMENTS = bitbar/bitbar.entitlements; 423 | COMBINE_HIDPI_IMAGES = YES; 424 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 425 | GCC_PREFIX_HEADER = "bitbar/bitbar-Prefix.pch"; 426 | INFOPLIST_FILE = "bitbar/bitbar-Info.plist"; 427 | MACOSX_DEPLOYMENT_TARGET = 10.7; 428 | PRODUCT_BUNDLE_IDENTIFIER = com.philsong.bitbar; 429 | PRODUCT_NAME = "$(TARGET_NAME)"; 430 | WRAPPER_EXTENSION = app; 431 | }; 432 | name = Release; 433 | }; 434 | /* End XCBuildConfiguration section */ 435 | 436 | /* Begin XCConfigurationList section */ 437 | 830CE088171B6C3E00DDD525 /* Build configuration list for PBXProject "bitbar" */ = { 438 | isa = XCConfigurationList; 439 | buildConfigurations = ( 440 | 830CE0BC171B6C3F00DDD525 /* Debug */, 441 | 830CE0BD171B6C3F00DDD525 /* Release */, 442 | ); 443 | defaultConfigurationIsVisible = 0; 444 | defaultConfigurationName = Release; 445 | }; 446 | 830CE0BE171B6C3F00DDD525 /* Build configuration list for PBXNativeTarget "bitbar" */ = { 447 | isa = XCConfigurationList; 448 | buildConfigurations = ( 449 | 830CE0BF171B6C3F00DDD525 /* Debug */, 450 | 830CE0C0171B6C3F00DDD525 /* Release */, 451 | ); 452 | defaultConfigurationIsVisible = 0; 453 | defaultConfigurationName = Release; 454 | }; 455 | /* End XCConfigurationList section */ 456 | }; 457 | rootObject = 830CE085171B6C3E00DDD525 /* Project object */; 458 | } 459 | --------------------------------------------------------------------------------