I am using python-twitter library, but I am unable to get the timeline of a specified user. Example
print [s.text for s in api.GetUserTimeline('@BarackObama')]
returns:
[u'test']
which is my last tweet (api is the object returned by tweeter.Api(...)).
Can someone help me with this?
EDIT: The complete code:
import twitter
api = twitter.Api(consumer_key='',consumer_secret='',access_token_key='',access_token_key='')
print [s.text for s in api.GetUserTimeline('BarackObama')]
Try this instead (screen_name will accept @BarackObama
, BarackObama
or barackobama
):
print [s.text for s in api.GetUserTimeline(screen_name='@BarackObama')]
(c.f. GetUserTimeline
test code in twitter_test.py - which is to say that the documentation needs to be updated)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With