Fixed the for loop key and how to access the user name.

This commit is contained in:
Rubén Varela Rosa 2013-05-26 12:53:55 -04:00
parent b99db3c90c
commit 464360c7f7

View file

@ -7,6 +7,6 @@ try:
except TwythonError as e: except TwythonError as e:
print e print e
for tweet in search_results['results']: for tweet in search_results['statuses']:
print 'Tweet from @%s Date: %s' % (tweet['from_user'].encode('utf-8'), tweet['created_at']) print 'Tweet from @%s Date: %s' % (tweet['user']['screen_name'].encode('utf-8'), tweet['created_at'])
print tweet['text'].encode('utf-8'), '\n' print tweet['text'].encode('utf-8'), '\n'