CONSUMER_SECRET = 'xxx' # Make sure access level is Read And Write in the Settings tab
ACCESS_KEY = 'xxx'
ACCESS_SECRET = 'xxx'
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
search_results = tweepy.API.search(api, 'hi', show_user = True)
print search_results
for tweet in search_results:
try:
print 'tweet:', tweet.from_user
except:
print 'fail'
finally:
pass
I am able to search for tweets and print them out (if I do print tweet.text then I see tweets) but I can't figure out how to see the user that tweeted these tweets. I've been searching through the docs for hours - what am I missing?!
`tweet.user`
`tweet.user`