How to get the complete list of followers

2019-02-19 03:20发布

Using the last version of the tweetsharp library for the twitter api, i am trying to get all the followers for a specific user. But i can only get the last 100 followers with this method:

IEnumerable<TwitterUser> f_followers = service.ListFollowersOf(user_id);

This method has a second parameter which is "long cursor", but i don't know how to use it. I tried to use it as an offset but it does not work. I presume that after each request, i need a cursorNext that i can use for the next request.

IEnumerable<TwitterUser> f_followers = service.ListFollowersOf(user_id, cursorNext);

Thank you for your help.

1条回答
别忘想泡老子
2楼-- · 2019-02-19 03:56

I don't know tweetsharp at all, but based on the following link you could try the following:

var followers = service.ListFollowersOf(user_id);
while (followers.NextCursor != null)
{
    followers =  service.ListFollowersOf(user_id, followers.NextCursor);
}
查看更多
登录 后发表回答