Python: How to get many tweets with function search() in Twython
In module Twython
you can use function search()
to search tweets
import os
from twython import Twython
CONSUMER_KEY = os.getenv('TWITTER_CONSUMER_KEY')
CONSUMER_SECRET = os.getenv('TWITTER_CONSUMER_SECRET')
# --- main ---
twitter = Twython(CONSUMER_KEY, CONSUMER_SECRET)
result = twitter.search(q='python', count=100)
tweets = result['statuses']
for number, item in enumerate(tweets, 1):
print(number, '|', item …