Strategy - Tweet Refresh

Aug 14, 2014 at 5:48 PM
Hello,
Is there a known method or strategy to redownload just the statistics for a tweet?

For example, my app has already downloaded a tweet yesterday. This tweet had say 0 RTs and 0 Favorites. Now I can see on Twitter that this tweet had 2 RTs and 5 Favorite marks. I need my app to download these stats.

Taking this forward, is there a way to query Twitter for a set of tweet Ids asking if there are any stats updates (or changes like tweet-deleted) for them?

Thanks!
Coordinator
Aug 18, 2014 at 12:31 AM
Well, I would advise you to use the UserStream.
Using the UserStream you will be able to see all the events occurring to the tweets available on your timeline in live.

User Feed Example

Linvi
Aug 18, 2014 at 4:26 AM
I don't want it "live". In fact, my application scenario explicitly does not want it live.

What I have is a Windows service that periodically polls Twitter for messages about particular topics of interest (like specific hashtags). Now after a tweet has been posted, its statistics may get updated. The only stats I am interested in is the number of Retweets and number of "favorite" flags for that tweet.

While I can do a GET statuses/show/:id. However, as per this page ( https://dev.twitter.com/docs/api/1.1/get/statuses/show/%3Aid ), I get back the whole original tweet object. This is perfectly okay, but I imagine over a period of time, I would need to file this GET request for each tweet I have (filtering for a reasonable time window, leaving out quite older ones and ones that are fairly the latest). This would quickly use up all of my rate limits :-(

An alternate I can think of is to re-fire my original request, get all of the objects all over again and then look through them for new tweets and updates to old tweets and update my data containers appropriately :-(

Anything you know in your Tweetinvi code base that can significantly reduce all those rate limit usages and multiple calls would be greatly helpful :-) :-)
Coordinator
Aug 18, 2014 at 11:21 AM
What you could do is use the method that you highlighted as it can retrieve up to 100 tweets per request => 100*180 = 18000tweets/15min.
Unfortunately I have not implemented this one yet, but I will implement it in next release for you.

Here is the code you can use:
var ids = new[] {20, 432656548536401920};
var queryParameters = String.Join("%2C", ids);
var query = "https://api.twitter.com/1.1/statuses/lookup.json?id=" + queryParameters;

var tweetDTOs = TwitterAccessor.ExecuteGETQuery<IEnumerable<ITweetDTO>>(query);
var tweets = Tweet.GenerateTweetsFromDTO(tweetDTOs);
Let me know if this helps you.
Aug 18, 2014 at 11:41 AM
Thank you. That's a lifesaver! Will try it out and let you know (have still some ways to go before I get to that part of the code).

PS: Is there a way I can send you a private comm ? @linvi
Coordinator
Aug 18, 2014 at 1:28 PM
Sure, please use the contact form of Codeplex and I will reply to you :)

Regards,
Linvi