How to fetch maximum 800 tweets from ListTweetOnHomeTimeline() method of TweetSharp?
Asked Answered
G

2

2

I'm making a demo app and I want 800 tweets to show of a particular user. I know that twitter api allows only 200 tweets per call and we can get max 800 tweets.

IEnumerable<TwitterStatus> homeTweets = service.ListTweetsOnHomeTimeline(new ListTweetsOnHomeTimelineOptions { Count = 200 });

Through this i'm able to get the 200 tweets in a call but not able to get the max 800 tweets.

Basically I want to fetch max 800 tweets from ListTweetsOnHomeTimeline() method.

How to get it?

Any help will be appreciated

Guberniya answered 26/9, 2013 at 15:3 Comment(0)
G
2

After spending some time I'll find out how to get the maximum tweets. like this:

IEnumerable<TwitterStatus> homeTweets = service.ListTweetsOnHomeTimeline(new ListTweetsOnHomeTimelineOptions { Count = 200 });


var tweet2 = service.ListTweetsOnHomeTimeline(new ListTweetsOnHomeTimelineOptions { Count = 200, MaxId = homeTweets.Last().Id });

Get the ID of last tweet from homeTweets and set it to the MaxId when calling the ListTweetsonHomeTimeline() method again. By doing this you will get the next 200 tweets, continuing performing the same task will get you the maximum 800 Tweets.

Guberniya answered 27/9, 2013 at 8:8 Comment(0)
D
0
            Twitter_service.ListTweetsOnUserTimeline(new ListTweetsOnUserTimelineOptions { Count = count }, (stat, response) =>
            {

               var a = stat;
               var Tweet_id = stat.Min().Id;
              Twitter_service.ListTweetsOnUserTimeline(new ListTweetsOnUserTimelineOptions { Count = count, MaxId = Tweet_id }, (stat1, response1) =>
                    {
                        if (response.StatusCode == HttpStatusCode.OK)
                        {
Detergency answered 28/9, 2013 at 11:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.