質問

I'm trying to post a tweet with the tweepy library. I use this code:

import tweepy

CONSUMER_KEY ="XXXX"
CONSUMER_SECRET = "XXXX"   
ACCESS_KEY = "XXXX"    
ACCESS_SECRET = "XXXX"

auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)

api = tweepy.API(auth)
api.update_status('Updating using OAuth authentication via Tweepy!')

But when I run the application, I receive this error:

raise TweepError(error_msg, resp)
TweepError: Read-only application cannot POST.

How can I fix this?

役に立ちましたか?

解決

In the application's settings, set your Application Type to "Read and Write". Then renegotiate your access token.

他のヒント

the code works for me with only

api.update_status (**status** = 'Updating using OAuth authentication via Tweepy!')

You have to set your app to read and write enter image description here

After that, you'll be able to run your code.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top