Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to post a tweet using tweepy? #1770

Closed
yesdeepakmittal opened this issue Jan 19, 2022 · 3 comments
Closed

How to post a tweet using tweepy? #1770

yesdeepakmittal opened this issue Jan 19, 2022 · 3 comments
Labels
API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion Question This is a question

Comments

@yesdeepakmittal
Copy link

How can I post a tweet using API.update_status()? It needs POST permission but I did not find this app permission option on the Twitter Developer App page.

@realrodri
Copy link

You need to apply for the "Elevated" Twitter Developer program. It's free, you just need to submit a form and maybe a couple of emails due to Twitter's auto response, but then you should be good to go. I'd recommend then follow this steps:

First, install tweepy library (pip install tweepy).

Next, create a .py file containing this:

import tweepy
auth = tweepy.OAuthHandler("CONSUMER KEY HERE", "CONSUMER KEY SECRET HERE")
auth.set_access_token("ACCESS TOKEN HERE", "ACCESS TOKEN SECRET HERE")
api = tweepy.API(auth)
tweet = input(" ")
api.update_status(status =(tweet))
print ("Done!")

Your tweet should be live then.

@bybilal
Copy link

bybilal commented Jan 24, 2022

how am i able to post a tweet with only the essential account?

@Harmon758
Copy link
Member

The OAuth 1.0a App permissions setting is under the User authentication settings section of the Settings tab of your developer portal's App page.

@Harmon758 Harmon758 added API This is regarding Twitter's API Question This is a question labels Jan 25, 2022
@tweepy tweepy locked and limited conversation to collaborators Jan 25, 2022
@Harmon758 Harmon758 converted this issue into discussion #1787 Jan 25, 2022
@Harmon758 Harmon758 added the Discussion This was converted/moved from/to a discussion label Jan 25, 2022

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
API This is regarding Twitter's API Discussion This was converted/moved from/to a discussion Question This is a question
Projects
None yet
Development

No branches or pull requests

4 participants