Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

updating twitter status from an application using oauth and twython

I've created an application on twitter's developers site, generated the access token/secret;

Using python-twitter I can update the status of the application account:

import twitter
oauth = twitter.OAuth(OAUTH_TOKEN, OAUTH_SECRET, TWITTER_TOKEN, TWITTER_SECRET)
t = twitter.Twitter(auth=oauth)
t.statuses.update(status="I've updated my account status")

I can't find a way of doing this with twython, expected this to work:

from twython import Twython
twitter = Twython(twitter_token = TWITTER_TOKEN,
                      twitter_secret = TWITTER_SECRET,
                      oauth_token = OAUTH_TOKEN,
                      oauth_token_secret = OAUTH_SECRET)
print twitter.updateStatus(status="I'm not working")

but all I get is: {u'request': u'/1/statuses/update.json', u'error': u'Could not authenticate you.'}

(I don't want the handshake described in twython's example django app, I just want my app to update the status of the connected account without further user interaction)

like image 594
simone cittadini Avatar asked Nov 14 '22 08:11

simone cittadini


1 Answers

I'm the author of Twython. Can you tell me which version of Twython you're using? One of the recent releases had an annoying bug related to this, would like to make sure that's not what's hitting you. ;)

like image 124
Ryan McGrath Avatar answered Dec 28 '22 06:12

Ryan McGrath