Iterating through retweeters

May 8, 2014 at 10:33 PM
My test tweet has one retweet.
When I use Tweetinivi.Tweet.GetTweet(id) I get the correct object back, and the RetweetCount has a value of 1.

There is another property called Retweets, that is of type List<Tweetinvi.Core.Interfaces.ITweet>, which is always null.

Is there a way to see who retweeted the post in question? I'm ultimately trying to get each "retweeters" FollowerCount...see what kind of "Reach" the post got.

I'd be grateful if someone could point me in the right direction.
Coordinator
May 8, 2014 at 11:49 PM
Hi there,

The ITweet.Retweets is a store collection. It has been added for developers to let them store the information within a Tweet object.
This collection is neither updated nor created when retrieving a tweet.

In order to get the retweets of a Tweet, Twitter provides this method.
Tweetinvi has implemented this feature with Tweet.GetRetweets();
var tweet = Tweet.GetTweet(tweetId);
var retweets = Tweet.GetRetweets(tweet);
Twitter also provide another method that sends a list of user ids who retweeted a tweet.
This method has not yet been implemented in Tweetinvi but I could provide some code to get these information in few lines of code thanks to the custom queries of Tweetinvi.

Please let me know if this help.
Linvi
Marked as answer by linvi on 5/9/2014 at 1:29 AM
May 9, 2014 at 12:16 AM
Iterating over the retweets from your example above got me exactly what I was looking for.
Are there api hits when I access the "Creator.FollowersCount" from the tweets returned, is there some lazy loading going on?

If I would use less api hits using twitters method of getting userid's who retweeted, then looking up the user....I'll probably go down the path, otherwise everything is working great for me.

Note: EXCELLENT api wrapper. Great Work!
Coordinator
May 9, 2014 at 8:29 AM
Hi,

Are there api hits when I access the "Creator.FollowersCount" from the tweets returned, is there some lazy loading going on?

In Tweetinvi > 0.9 there is no lazy-loading going on.
If you need an information that is not currently set or accessible you need to use the available features to get the information.

For example if a user is not provided with a tweet (which happens when the trim_user parameter of a request is set to true) the Creator parameter will be null.

If I would use less api hits using twitters method of getting userid's who retweeted, then looking up the user....I'll probably go down the path.

I am not sure to understand what you mean. Which request to think is using too much api hits? Note that every distinct method uses tokens from distinct rate-limits.
For example accessing a Tweet will not affect the rate-limit of accessing the Retweets of a Tweet.

Note: EXCELLENT api wrapper. Great Work!

Glad you like it. Feel free to rate or follow the project. Following the projects allows you to receive an email when a new version is release (every 2-3 months).

Regards,
Linvi
Aug 19, 2014 at 5:24 PM
Edited Aug 19, 2014 at 7:08 PM
I'm making a contest where the person that has the tweet, with the most retweets wins a prize. And I'm using:
var tweet = Tweet.GetTweet(tweetId);
var retweets = Tweet.GetRetweets(tweet);
But I have a few questions. For example, I'm also using:
var rateLimits = RateLimit.GetCurrentCredentialsRateLimits();
I'd like to know what the limitations are. Is there a limit of requests I can make per hour? Per tweet? How do these limitations work?

For example, if there's a 60 requests limits. Is it a global limit? Can I make only 60 requests for all tweets as a whole? Or can I make 60 per tweet? And what's the limit refresh time?

Is this method for the REST API 1.1 or for the Streaming API? And do both have the same limits?

Thanks in advance for you're replies. I've been looking for a reliable twitter library for .net and up until now, tweetinvi has been the best one around.
Coordinator
Aug 20, 2014 at 12:08 AM
Hello there,

RateLimit.GetCurrentCredentialsRateLimits can be invoked 180 times every 15 minutes for a specific user account.
This will give you all the rate limits associated with your current Token.

One of the problem you are facing is that you will have to get the retweets of all the tweets of your contest every x minutes.
What you could do, is use the Lookup query (https://tweetinvi.codeplex.com/discussions/561185).

In a Tweet you have a RetweetCount property that you can use for your contest.

Please let me know if this helps.
Linvi