Question

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?

Was it helpful?

Solution

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

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top