在身份验证后获取Twitter好友列表 [英] Fetch Twitter Friend List after Authentification
本文介绍了在身份验证后获取Twitter好友列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用 MGTwitterEngine.m
中的以下方法来获取朋友列表:
I've used the following method from MGTwitterEngine.m
in order to fetch the friend list:
(NSString *)getFriendsIds:(NSString *)twitterID
{
NSString *path = [NSString stringWithFormat:@"friends/ids.%@", API_FORMAT];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
[params setObject:twitterID forKey:@"user_id"];
return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil
requestType:MGTwitterUserInformationRequest
responseType:MGTwitterUsers];
}
在我班上我做了以下电话:
And in my class I've made the following call:
NSLog(@"friends %@",[_engine getFriendsIds:@"user_id"]);
我无法检索好友列表。
推荐答案
- (void)userInfoReceived:(NSArray *)userInfo forRequest:(NSString *)connectionIdentifier {
//NSLog(@"User Info Received: %@", userInfo);
followTweet = [[TweetFollow alloc]initWithStyle:UITableViewStylePlain];//Table
TweetModel *tweetFollw = [[TweetModel alloc]initWithTweetFollwerArray:userInfo];//Model
[followTweet.tweetFollow addObject:tweetFollw];
NSLog(@"ARRYYYYYY: %@",followTweet.tweetFollow );
followTweet.view.frame = CGRectMake(161, 0, 160, 420);
[self.view addSubview:followTweet.view];
[tweetFollw release];
}
#define TWITTER_DOMAIN @"api.twitter.com/1" // Plz change this in to MGTwitterEngin.m
-(void)viewWillApper {
//_engine is instance of MGTwitterEngin class
[_engine getFollowersIncludingCurrentStatus:NO];
}
这是一个简单的代码,您可以通过它获得推特朋友清单
谢谢!!
This is simple code by which you can get the twitter Friend list ; Thank you !!
这篇关于在身份验证后获取Twitter好友列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文