簡體   English   中英

Twitter API:如何獲取Twitter用戶關注的用戶列表(MGTwitterEngine for Obj-C)

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

我想知道是否可以通過MGTwitterEngine for Obj-C獲得Twitter用戶關注的朋友列表(以下列表)?

如果有可能,請指導我該怎么做,謝謝

你被允許 MGTwitterEngine在AppController.m中提供了其方法的示例代碼。 這是用於檢索任何人關注的列表的方法。

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

將其與關注者方法一起添加到MGTwitterEngine.h

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

並將其與MGTwitterEngine.m以及關注者方法一起使用

- (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];
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM