Reputation: 21
LinqToTwitter: How to search tweets of users which i follow?
Using below code, I m getting results for all pubic tweets but i want to query tweets of users which i follow?
var twitterCtx = new TwitterContext(auth);
var searchResults =
from search in twitterCtx.Search
where search.Type == SearchType.Search
&& search.Query == txtQuery.Text
select search;
var searched = searchResults.SingleOrDefault();
Upvotes: 2
Views: 1132
Reputation: 7513
Though the Twitter API doesn't offer the option you need, there are a couple things that might come close to what you want: a 'from' operator or a stream.
You can visit the Twitter Search page and view the list of operators that you can include in your LINQ to Twitter Query. One of these operators is 'from'. This appears to be only a single user, but it sounds like you want all of your followers. Anyway, you can experiment on the Twitter Search page to see what results you get and then translate that into the LINQ to Twitter Query.
Another approach might be to use a Filter Stream. It has a Follow property that takes a comma-separated list of users. With the Search above, you're doing request/response. However, streams are different in that you open the connection and listen for a long time, processing responses as they arrive.
Upvotes: 1