Untitled
unknown
plain_text
3 years ago
837 B
25
Indexable
import tweepy # Set the Twitter API keys consumer_key = 'your-consumer-key' consumer_secret = 'your-consumer-secret' access_token = 'your-access-token' access_token_secret = 'your-access-token-secret' # Authenticate with the Twitter API auth = tweepy.OAuthHandler(consumer_key, consumer_secret) auth.set_access_token(access_token, access_token_secret) # Create the API object api = tweepy.API(auth) # Set the username to monitor username = 'sbf_ftx' # Get the user's timeline timeline = api.user_timeline(username) # Loop through the timeline and reply to each tweet for tweet in timeline: # Check if the tweet is from the username if tweet.user.screen_name == username: # Reply to the tweet with the message api.update_status('@' + username + ' Where has it all gone sam?', in_reply_to_status_id=tweet.id)
Editor is loading...