-
-
Save thakyZ/b3479b35c198a306230e799934b1757e to your computer and use it in GitHub Desktop.
tweet_from_fridge with replies (Python)
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 sys, os, time | |
import tweepy | |
#Credit to KonradIT on GithubGist for making the original script, tweet_from_fridge.py | |
#I had only modified it so it can reply to tweets, nothing else. | |
#All credit goes to the original author. | |
keys = dict( | |
consumer_key='put', | |
consumer_secret='your', | |
access_token='tokens', | |
access_token_secret='here' | |
) | |
ReplyMode = input("Reply? (respond with 'y' or 'n'): ") | |
user = "@<username>" | |
auth = tweepy.OAuthHandler(keys['consumer_key'], keys['consumer_secret']) | |
auth.set_access_token(keys['access_token'], keys['access_token_secret']) | |
api = tweepy.API(auth) | |
if ReplyMode == "y": | |
def tweet(): | |
TweetID = input("Reply to: ") | |
message = input("tweet: ") | |
api.update_status(message, in_reply_to_status_id=TweetID, auto_populate_reply_metadata=True) | |
sys.exit() | |
else: | |
def tweet(): | |
message = input("tweet: ") | |
api.update_status(message) | |
sys.exit() | |
if __name__ == "__main__": | |
while 1: | |
tweet() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment