Skip to content

Instantly share code, notes, and snippets.

@faderzz
Created December 30, 2022 18:32
Show Gist options
  • Save faderzz/90505eb4c3fe7f974a2b8e647223ad2a to your computer and use it in GitHub Desktop.
Save faderzz/90505eb4c3fe7f974a2b8e647223ad2a to your computer and use it in GitHub Desktop.
See what platform a tweet was sent from
## 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