user1106784
user1106784

Reputation: 163

How do I return 100 tweets with linq-to-twitter API?

I've been trying to use the twitter API 1.1 Linq to Twitter (for c#) to search for tweets at #something.

This is what I came up with:

var query = (from tweet in twitterContext.Search
                  where tweet.Type == SearchType.Search &&
                  tweet.Query == "#something"
                  select tweet).SingleOrDefault();

The problem is that this query only returns 6 statuses and I want to get at least 100. I've tried adding:

tweet.Count == 100

and

tweet.Statuses.Count == 100

with no luck, does anybody know what I am doing wrong?

Upvotes: 1

Views: 792

Answers (1)

Joe Mayo
Joe Mayo

Reputation: 7513

tweet.Count is correct. Twitter is only returning 6 statuses. Twitter search isn't a normal search engine. Their search algorithm only goes back a certain number of days (undefined), doesn't necessarily return all matches, and won't return results for certain types of queries. You can test by performing the same search at https://twitter.com/search-home.

Upvotes: 2

Related Questions