1

How would I limit the number of results in a twitter search?

This is what I thought would work...tweetSearchUser is user input in another line of code.

tso = TwitterSearchOrder() # create a TwitterSearchOrder object
    tso.set_keywords(["tweetSearchUser"]) # let's define all words we would like to have a look for
    tso.setcount(30)
    tso.set_include_entities(False) # and don't give us all those entity information

Was looking at this reference

https://twittersearch.readthedocs.org/en/latest/advanced_usage_ts.html

tried this, seems like it should work but can't figure out the format to enter the date...

tso.set_until('2016-02-25')
Staley
  • 55
  • 2
  • 11
  • The reference says `This library is trying to not hide anything from your eyes except the complexity of its functions. Due to this you’re able to get all the information available (which can be quite a lot)`. So it appears that you need to do some filtering your self, or try a different twitter tool. – Xiongbing Jin Feb 28 '16 at 19:27
  • You should pass a `datetime.date` object https://docs.python.org/2/library/datetime.html#datetime.date – Forge Feb 28 '16 at 19:45

1 Answers1

1

You should use set_count as specified in the documentation.
The default value for count is 200, because it is the maximum of tweets returned by the Twitter API.

Forge
  • 6,538
  • 6
  • 44
  • 64