finding out retweets

May 9, 2011 at 11:36 AM

Joey, hi, 

I understand it is possible to find the number of people following me, but is it possible to find the number of people and their twitter ids who have retweeted my  tweets.

Thanks

Arnab

Coordinator
May 9, 2011 at 2:25 PM

Hi Arnab,

That would be a Status entity query of StatusType.RetweetsOfMe.  An example would look like this:

            var myRetweets =
                from retweet in twitterCtx.Status
                where retweet.Type == StatusType.RetweetsOfMe
                select retweet;

You can get more info, such as available parameters, from the Getting Statuses Retweeted About a User docs.

@JoeMayo

May 17, 2011 at 3:59 AM

Thanks, Joe

The code I see from docs, provides you the most recent 20 retweets but there are also some parameters which can give you more.

If I have a user with more than a million followers and I need to know how many unique followers (just their id and screenname) retweeted his tweets, could you please tell me the best way of doing this.

Regards

Arnab 

Coordinator
May 17, 2011 at 2:33 PM

Hi Arnab,

Unlike other methods, status queries still use a page parameter.  So, you would need to set a loop to continue requesting the next page until you don't receive any results back.  Also, use the Count parameter, which can be set to a max of 200 to minimize the number of queries.  That's as far as you can take this with Twitter and it isn't a limitation of LINQ to Twitter, but rather the fact that the Twitter API doesn't offer the feature.  There isn't anything stopping you from finding the unique followers via further processing on your own.

Since you're dealing with someone with so many followers, you might be running into memory issues.  If you have the memory resources, you can use LINQ to Objects to perform a query on the results from the LINQ to Twitter query to get unique followers who retweeted, perhaps a union of IDs.  If the results are too large, another option might be to push the results from the LINQ to Twitter query into a db and perform the unique followers query with whatever DB technology you're using.

Hope it helps,

Joe