Tag: Twitter TwitterAPI
http://github.com/mattgemmell/MGTwitterEngineからダウンロードできる。
git clone http://github.com/mattgemmell/MGTwitterEngine.git
自分用
git clone git@github.com:src256/MGTwitterEngine.git
Under 'Other Linker Flags' in the Test target, add -ObjC and -all_load (So NSObject+YAJL category is loaded).
#define YAJL_AVAILABLE 1
# define USE_LIBXML 1
$SDKROOT/usr/include/libxml2
RootViewController.mのviewDidLoadなどで試しによびだしてみる。タイムラインが取得できればOK。
#import "MGTwitterEngine" - (void)viewDidLoad { //(省略) MGTwitterEngine *twitterEngine = [[MGTwitterEngine alloc] initWithDelegate:self]; [twitterEngine setUsername:@"xxxx" password:@"yyyyy"]; [twitterEngine getFollowedTimelineSinceID:0 startingAtPage:0 count:10]; } - (void)statusesReceived:(NSArray *)statuses forRequest:(NSString *)connectionIdentifier { //成功した場合 for (NSDictionary *status in statuses) { NSLog(@"Tweet Text: %@", [status objectForKey:@"text"]); } } - (void)requestFailed:(NSString *)connectionIdentifier withError:(NSError *)error { //失敗した場合 NSLog(@"Request failed for connectionIdentifier = %@, error = %@ (%@)", connectionIdentifier, [error localizedDescription], [error userInfo]); }