@verbose
def search_demo(keywords='nltk'):
 oauth = credsfromfile()
 client = Query(**oauth)
 for tweet in client.search_tweets(keywords=keywords, limit=10):
  print(tweet['text'])

@ verbose def search_demo ( keywords = 'nltk' ) : oauth = credsfromfile ( ) client = Query ( ** oauth ) for tweet in client . search_tweets ( keywords = keywords , limit = 10 ) : print ( tweet [ 'text' ] )
use the rest api to search for past tweets containing a given keyword .