Created
December 30, 2022 18:32
-
-
Save faderzz/90505eb4c3fe7f974a2b8e647223ad2a to your computer and use it in GitHub Desktop.
See what platform a tweet was sent from
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
## INSTALL TWEEPY MODULE | |
# Import tweepy | |
import tweepy | |
# api keys | |
consumer_key = "consumer key here" | |
consumer_secret = "consumer secret here" | |
access_token = "access token here" | |
access_token_secret = "access token secret here" | |
# authenticate and create an API object | |
auth = tweepy.OAuth1UserHandler(consumer_key, consumer_secret, access_token, access_token_secret) | |
api = tweepy.API(auth) | |
# get the tweet with the specified ID | |
tweetID = input("Tweet ID: ") | |
tweet = api.get_status(tweetID) | |
# print the source of the tweet | |
print(tweet.source) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment