Twython : cursor on statuses/get_user_timeline returns my tweets instead of screen_name passed

533 views Asked by At

I started using Twython recently and was impressed by the simplicity. Thanks for the developing and maintaining the library.

However, when I tried running a cursor on get_user_timeline() endpoint, I got my timeline instead of the user specified in the 'screen_name' parameter. I ran the following with App auth.

twitter = Twython(APP_KEY, access_token=self.ACCESS_TOKEN) tweets = twitter.request("https://api.twitter.com/1.1/statuses/user_timeline.json", "GET", {'screen_name': '<some screen name>'})

that worked just fine for 20 tweets or 1 page worth of tweets.

I am wondering then why my below stated code did not work? twitter = Twython(APP_KEY, access_token=self.ACCESS_TOKEN) tweets = twitter.cursor(twitter.get_user_timeline, {"screen_name":"narendramodi"})

Am I using the cursor wrong? If so what would be an ideal way of using the endpoint in question.

Thanks for your answers in advance!

Thanks and Regards, Atul.

1

There are 1 answers

0
elachell On

This problem of getting the tweets from the authenticated user happened to me before. The reason was that I was giving as argument an non-existent user. Make sure you don't confuse the name with the screen-name.