Open maerco opened 8 years ago
Thanks for opening this issue.
As far as I see it, TwitterSearch works as intended here. The count argument does not limit the number of tweets you'll see in your use case. It does limit the number of tweets you'll receive within a single request, though.
In other words: if you're using it within the for-loop you'll only increase the overhead as the lib will simply do more queries to fetch all tweets. If you're sure you'll only need five tweets, you can still set the parameter and leave the for-loop after receiving all tweets you need. By doing so, you'll limit the overhead to a minimum.
Hope this answers the confusion and I guess we should add this point to the documentation as you can get confused easily by the name of the parameter :smile:
Hi,
Thanks for your replay, yes this clarify the point.
Anyway would be useful to include also a limit for each request, this could save bandwidth if we are performing frequent requests
There is already a statistical feature available. Just use the getStatistics() method of the TwitterSearch class.
All you need to do is a simple check against the amount of queries. If 5 queries or 1000 tweets are enough for you, just use break within the foreach-loop.
Although we could also implement a kind of limit feature within the TwitterSearch class to automatically break the loop.
tso.set_count(5) is not working on my side:
it's reporting hundred of results.