Created
December 5, 2021 02:41
-
-
Save ssrlive/6c163b99c53c3f4bb5534fc0d8627954 to your computer and use it in GitHub Desktop.
Tweet with images
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
consumer_key = u"" | |
consumer_secret = u"" | |
access_token = u"" | |
access_token_secret = u"" | |
auth = tweepy.OAuthHandler(consumer_key, consumer_secret) | |
auth.set_access_token(access_token, access_token_secret) | |
api = tweepy.API(auth) | |
#api.update_status("This Tweet was Tweeted using Tweepy!") | |
upload_result = api.media_upload('/home/ubuntu/a.jpg') | |
api.update_status(status="test tweet again", media_ids=[upload_result.media_id_string]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment