Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Getting all the tweets of an account

$
0
0
`Hi All,

I have noticed that i am unable to get tweets more than 3300. As there are 0.1 million tweets in an account which i want to read but i am able to read just 3300 tweets not more than that. How to read all the tweets thanks in advance.

where
var user = User.GetUserFromScreenName("abc_User");
const int maxId = 3300;
int page = 0;

string query = String.Format("https://api.twitter.com/1.1/statuses/user_timeline.json?user_id={0}&count={1}&page={2}", user.Id, maxId, page);
for (int y = 1; y < 700; y++)
        {
// Code to get tweets
List<ITweet> tweetsList = new List<ITweet>();
         query = String.Format("https://api.twitter.com/1.1/statuses/user_timeline.json?user_id={0}&count={1}&page={2}", user.Id, maxId, page);
         result = TwitterAccessor.ExecuteJsonGETQuery(query);
        searchQueryHelper = TweetinviContainer.Resolve<IJsonObjectConverter>();
        tweetDTOs = searchQueryHelper.DeserializeObject<List<ITweetDTO>>(result);
        IEnumerable<ITweet> tweets =     
                                        Tweet.TweetFactory.GenerateTweetsFromDTO(tweetDTOs);
        tweetsList.AddRange(tweets);
        page++;
}

Best Regards,
Asad Naeem

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>