3

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.

M.Babcock
  • 18,753
  • 6
  • 54
  • 84
mathieurip
  • 547
  • 1
  • 6
  • 16
  • Based on the tweetsharp code it looks like the overload that takes the `long cursor` is intended to be used for paging. If your goal is to get a complete list of followers then this probably isn't the method you want to use. – M.Babcock Jan 05 '12 at 13:55

1 Answers1

3

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);
}
ken2k
  • 48,145
  • 10
  • 116
  • 176
  • Thank you!! it works but i have to request first `var followers = service.ListFollowersOf(user_id,-1);` otherwise NextCursor will always be null. Thanks a lot!! – mathieurip Jan 06 '12 at 10:35