techteej
Aug 18, 2015 - 04:19
So I know this is pretty basic, but haven't found anything to really help me and I've exhausted my options to either get an error or a None return.
As you can see here, the attribute screen_name is inside of the attribute user which could easily be called by using ['user']['screen_name'] except in my instance below:
# coding: utf-8
import twitter
all_accounts = twitter.get_all_accounts()
if len(all_accounts) >= 1:
account = all_accounts[0]
tweets = twitter.get_home_timeline(account)
for t in tweets:
print t.get('text')
print t.get(['user']['screen_name'])
print '=' * 40
else:
print 'You don\'t have any Twitter accounts (or haven\'t given permission to access them).'
Any help is appreciated.