twittertwitterizer

Getting all twitter followers using twitterizer


I am using Twitterizer 2. in general it does the job very well, but I have one thing missing.
I need to get all the followers of my user. and the method brings Twitterizer.TwitterFriendship.Followers(Token) only brings 100 of them.
in the twitter API I saw that you can use a cursor for "paging" you request, but I couldn't find this functionality in twitterizer.
Any Idea anyone?


Solution

  • The TwitterUserCollection class (that is returned by the Followers method) have NextPage() and PreviousPage() methods that will perform the paging for you.

    For example, to get all of your followers, you can perform this:

    TwitterUserCollection myFollowers = TwitterFriendship.Followers(token);
    
    while (myFollowers != null)
    {
        // Do something with the users here
    
        // Get the next page
        myFollowers = myFollowers.NextPage();
    }
    

    If you have additional questions, please post them in our forums: http://forums.twitterizer.net/