3

I'm using the python-twitter API and whatever I pass to the below code as user, still returns my timeline and not the required user's. Is there something I'm doing wrong?

import twitter
api = twitter.Api(consumer_key=CONSUMER_KEY,
                      consumer_secret=CONSUMER_SECRET,
                      access_token_key=ACCESS_KEY,
                      access_token_secret=ACCESS_SECRET)
user = "@stackfeed"
statuses = api.GetUserTimeline(user)
print [s.text for s in statuses]

When I do not pass the required fields into twitter.Api, it gives me an authentication error.

Sukrit Kalra
  • 33,167
  • 7
  • 69
  • 71
Anil
  • 2,430
  • 3
  • 37
  • 55

1 Answers1

4

You should use screen_name keyword argument, e.g.:

statuses = api.GetUserTimeline(screen_name="@gvanrossum")
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195