How to get all time most favorited status of a user?

Sep 26, 2013 at 12:00 PM
I am getting a user's tweets with this query:
var tweets = (from tweet in twitterCtx.Status
                     where tweet.Type == StatusType.User
                           && tweet.Count == 200
                           && tweet.ScreenName == screenName
                     orderby tweet.FavoriteCount descending).ToList();
But as you all know because of tweet.Count being maximum of 200, I can't get ALL TIME favorite, instead I get most favorited of last 200 tweets.

Is there anyway I can implement this?

Thanks in advance.
Sep 26, 2013 at 3:16 PM

You can page through the timeline with since_id and max_id. The technique isn't immediately obvious, but it makes sense once you understand why. I've written a blog post, Working with Timelines with LINQ to Twitter, on how to do this with LINQ to Twitter, which also references Twitter API's documentation with a good explanation of the process.

Sep 30, 2013 at 7:32 AM
Thanks Joe, that really helped.

I tried same approach while searching hashtags. I am trying a very popular hashtag in my country, #occupygezi. I believe this hashtag started in early june. But when I try this approach the earliest status I get is from september 22nd.

The code I am using is like this:
userStatusResponse =
                (from search in twitterCtx.Search
                 where search.Type == SearchType.Search
                       && search.Query == hashtagName
                       && search.SinceID == sinceID
                       && search.Count == Count
                       && search.MaxID == maxID
                 select search)
... where hashtagName is occupygezi, not #occupygezi or something.

Thanks for any help.
Sep 30, 2013 at 8:56 AM
The Twitter API will only go back a certain amount of time. If you need to go back further, Twitter has Certified Data Resellers (e.g. GNIP) that have the history of all tweets.