开发者

Twitter API : How to get a list of users that a Twitter's user follow (MGTwitterEngine for Obj-C)

开发者 https://www.devze.com 2023-01-25 09:55 出处:网络
I\'m wondering if I\'m allowed to get a list of friends that a twitter\'s user follow 开发者_JAVA百科(following list) through MGTwitterEngine for Obj-C ?

I'm wondering if I'm allowed to get a list of friends that a twitter's user follow 开发者_JAVA百科(following list) through MGTwitterEngine for Obj-C ?

If it's possible, please direct me how to do it Thanks


You're allowed. MGTwitterEngine has sample code for their methods in AppController.m. This is the method for retrieving a list of who anyone is following.

[twitterEngine getFriendIDsFor:@"username_here" startingFromCursor:-1]


ADD this to MGTwitterEngine.h along with followers methods

- (NSString *)getFollowingIncludingCurrentStatus:(BOOL)flag;

AND this to MGTwitterEngine.m along with followers methods

- (NSString *)getFollowingIncludingCurrentStatus:(BOOL)flag
{
    NSString *path = [NSString stringWithFormat:@"statuses/friends.%@", API_FORMAT];

    NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
    if (!flag) {
        [params setObject:@"true" forKey:@"lite"]; // slightly bizarre, but correct.
    }

    return [self _sendRequestWithMethod:nil path:path queryParameters:params body:nil 
                            requestType:MGTwitterFollowedTimelineRequest
                           responseType:MGTwitterUsers];
}
0

精彩评论

暂无评论...
验证码 换一张
取 消