Search code examples
c#.nettwitterlinq-to-twitter

Linq2Twitter how to get retweeters


I need to get just users' ids who retweeted some status. But problem is that I can't find GET statuses/retweeters/ids implementation in Linq2Twitter lib.

I've tried code below:

var retweets = (from u in twitterCtx.Status
            u.Type == StatusType.Retweets
            u.ID == statusId
            select u).ToList();

But according to documentation I can get only 100 frist top tweets. Also playing with MaxId parameter din't give any results.

Please help!!!

Update 1

May be I wasn't too clear. I want to make request GET statuses/retweeters/ids, not statuses/retweetes/:id


Solution

  • I just checked in support for this query. You can get the functionality by downloading the source code. It will be in the next release.

    Here's an example of how you can use it:

            var status =
                (from tweet in twitterCtx.Status
                 where tweet.Type == StatusType.Retweeters &&
                       tweet.ID == "210591841312190464"
                 select tweet)
                .SingleOrDefault();
    
            status.Users.ForEach(
                userID => Console.WriteLine("User ID: " + userID));