Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Two Questions About Geographic Search

$
0
0
Hi,

1-) I chose a point in Manhattan, set the radius to 10 km and the time interval to 1 week. SearchTweets() returns 600 tweets. Then I chose the same location, but this time I set the radius to 1km and time interval to just one day(one of the days from the previous chosen week), it now returns more than 1000 tweets.

So I conclude that the more specific search parameters I set(by reducing radius and time interval), the more realiable data I get. Is this right?

To be honest with you I have never compared the search result based on their radius, I cannot really give you any help regarding this question.

2-) Everytime I execute SearchTweets() method, my SearchTweetsLimit (initially 180) decreases. Is there a direct correlation between the number of tweets returned from SearchTweets() and the decreasing amount in SearchTweetsLimit? For example, can you say something like this: "Every 50 tweets you get, your SearchTweetsLimit decrements(one by one)"?

The short answer is NO.

You need to understand how Tweetinvi is performing the recursive searches as well as how Twitter works.
while (totalTweets.Count < tweetSearchParameters.MaximumNumberOfResults)
{
    if (tweets.IsEmpty())
    {
        // If Twitter does not have any result left, stop the searchbreak;
    }

    var oldestTweetId = _tweetHelper.GetOldestTweetId(tweets);
    searchParameter.MaxId = oldestTweetId - 1;
    searchParameter.MaximumNumberOfResults = Math.Min(tweetSearchParameters.MaximumNumberOfResults - totalTweets.Count, 100);
    query = _searchQueryGenerator.GetSearchTweetsQuery(searchParameter);
    currentResult = GetSearchResultsFromQuery(query);
    tweets = currentResult.TweetDTOs;
    totalTweets.AddRange(tweets);
    result.Add(currentResult);
}
Tweetinvi request the maximum number of Tweets it can in a single query. The real issue is that Twitter does not always return the maximum number of Tweets even if it has some additional data.

In the case of Search, Twitter allows 100 tweets to be retrieved per request. Therefore you could expect that if you want to retrieve 200 tweets you'll only have to perform 2 queries.

It was true for some time, but this is no longer the case. Retrieving 200 tweets can require 3 or 4 requests as followed.

Request 1 : 100 tweets
Request 2 : 20 tweets
Request 3 : 65 tweets
Request 4 : 100 tweets

Total : 285 tweets retrieved but Tweetinvi had to perform 4 requests instead of the 2 expected.

I hope this is clear.

Regards,
Linvi

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>