Reputation: 2585
I want to get mentions of a any user using linq to twitter api. I have a code which brings back the user time line, but I want to get only mentions of a user, one of the method that is Mention Timeline can only be used to get mentions for authenticatd user but I want to get for any user. How it is possible? Here is my code which return a user timeline, what modification require in it? Please help
var mentions= await _twitterContext.Status
.Where(s => s.ScreenName== ScreenName && s.Type == StatusType.User && s.Count == 200)
.ToListAsync();
Upvotes: 0
Views: 306
Reputation: 7513
The Twitter API doesn't expose an endpoint that allows you to get mentions for any user with a screen name. However, you can get the mentions if you are authorized by the user for whom you want to get mentions for. Here's an example:
var tweets =
await
(from tweet in twitterCtx.Status
where tweet.Type == StatusType.Mentions &&
tweet.ScreenName == "JoeMayo"
select tweet)
.ToListAsync();
PrintTweetsResults(tweets);
The documentation for this is here:
Upvotes: 1