Reputation: 5972
I have the following script:
twitter=Twython(consumer_key, consumer_secret, access_token, access_token_secret)
tags=['#pc', #computer', '#technology']
for tag in tags:
try:
search_results=twitter.search(q=tag, count=200)
except TwythonError as error:
print error
sys.exit()
for tweet in search_results['statuses']:
user = tweet['user']['screen_name'].encode('utf-8')
print user
But when I omit count or change it to 300 it shows me for each tag only 100 results. How can I change it to unlimit results?
[Methods in tweepy module is welcome as well]
Upvotes: 0
Views: 992
Reputation: 12613
Twitter API returns a maximum number of 100 tweets per request. Read Twitter APIs documentation.
To fetch more than 100 tweets you'll have to send more than one request and need to understand how Twitter timeline works. Check out this link.
Anyways, what you need to do is make use of the max_id
variable. max_id
is basically the id of the last tweet that you've fetched.
Upvotes: 2