suffix = '#FreudSaysIDo' # The maxconvdepth is the maximum depth of the conversation that the bot will # still reply to. This is relevant if you want to reply to all tweets directed # at a certain user. You don't want to keep replying in the same conversation, # because that would be very annoying. Be responsible, and allow your bot only # a shallow conversation depth. For example, a value of 2 will allow the bot # to only reply in conversations where there are two or less replies to the # original tweet. maxconvdepth = None # Start auto-responding to tweets by calling twitter_autoreply_start # This function operates in a Thread in the background, so your code will not # block by calling it. tweetbot.twitter_autoreply_start(targetstring, keywords=keywords, prefix=prefix, suffix=suffix, maxconvdepth=maxconvdepth) # Start periodically tweeting. This will post a tweet every X days, hours, and # minutes. (You're free to choose your own interval, but please don't use it to # spam other people. Nobody likes spammers and trolls.) # This function operates in a Thread in the background, so your code will not # block by calling it. tweetbot.twitter_tweeting_start(days=0, hours=19, minutes=30, keywords=None, prefix=None, suffix='#BleepBloop')
respdict = {u'Kendrick Lamar':( \ u'HEDLEY! https://www.youtube.com/watch?v=8vjEnkQdaHM', u'HEDLEY! http://jpg.party/http://i.imgur.com/lzLPfT3.gif', u'HEDLEY! http://jpg.party/http://i.imgur.com/nAV7ueU.gif', u'HEDLEY! http://jpg.party/http://i.imgur.com/3yt4gex.jpg', u'HEDLEY! http://jpg.party/http://i.imgur.com/6COCqT1.jpg', u'HEDLEY! http://jpg.party/http://i.imgur.com/C9pcsJI.jpg' )} # Add the respdict to the bot's database. tweetbot.set_simple_responses(respdict) # Log in to Twitter. print(u"\nBot is logging in to Twitter.") tweetbot.twitter_login(cons_key, cons_secret, \ access_token, access_token_secret) # Start auto-responding to tweets. print(u"\nBot is starting the auto-replying Thread.") tweetbot.twitter_autoreply_start(u'Kendrick Lamar', database=u'simpleresponse', keywords=None, prefix=None, suffix=u'#HeldeyLamar', maxconvdepth=None) # Run indefinitively while True: # Sleep for a minute, to avoid wasting resources. time.sleep(60)
prefix = None # The suffix will be added to the end of all outgoing tweets. suffix = '#FreudSaysIDo' # The maxconvdepth is the maximum depth of the conversation that the bot will # still reply to. This is relevant if you want to reply to all tweets directed # at a certain user. You don't want to keep replying in the same conversation, # because that would be very annoying. Be responsible, and allow your bot only # a shallow conversation depth. For example, a value of 2 will allow the bot # to only reply in conversations where there are two or less replies to the # original tweet. maxconvdepth = None # Start auto-responding to tweets by calling twitter_autoreply_start # This function operates in a Thread in the background, so your code will not # block by calling it. tweetbot.twitter_autoreply_start(targetstring, keywords=keywords, prefix=prefix, suffix=suffix, maxconvdepth=maxconvdepth) # Start periodically tweeting. This will post a tweet every X days, hours, and # minutes. (You're free to choose your own interval, but please don't use it to # spam other people. Nobody likes spammers and trolls.) # This function operates in a Thread in the background, so your code will not # block by calling it. tweetbot.twitter_tweeting_start(days=0, hours=19, minutes=30, keywords=None, prefix=None, suffix='#BleepBloop') # DO SOMETHING HERE TO ALLOW YOUR BOT TO BE ACTIVE IN THE BACKGROUND # You could, for example, wait for a week: secsinweek = 7 * 24 * 60 * 60 time.sleep(secsinweek) # Use the following to stop auto-responding # (Don't do this directly after starting it, or your bot will do nothing!)
prefix = None # The suffix will be added to the end of all outgoing tweets. suffix = '#OrgulloLGTBI' # The maxconvdepth is the maximum depth of the conversation that the bot will # still reply to. This is relevant if you want to reply to all tweets directed # at a certain user. You don't want to keep replying in the same conversation, # because that would be very annoying. Be responsible, and allow your bot only # a shallow conversation depth. For example, a value of 2 will allow the bot # to only reply in conversations where there are two or less replies to the # original tweet. maxconvdepth = None # Start auto-responding to tweets by calling twitter_autoreply_start # This function operates in a Thread in the background, so your code # will not block by calling it. tweetbot.twitter_autoreply_start(targetstring, keywords=None, prefix=None, suffix='Cada vez que se dice Orgullo Gay un Unicornio Marino muere... se dice Orgullo LGTBI ;-) #OrgulloLGTBI #OrgulloLGTBIQ', maxconvdepth=None) # Start periodically tweeting. This will post a tweet every X days, hours, and # minutes. (You're free to choose your own interval, but please don't use it to # spam other people. Nobody likes spammers and trolls.) # This function operates in a Thread in the background, so your code will not # block by calling it. tweetbot.twitter_tweeting_start(days=0, hours=2, minutes=0, keywords=None, prefix=None, suffix='#OrgulloLGTBI') # DO SOMETHING HERE TO ALLOW YOUR BOT TO BE ACTIVE IN THE BACKGROUND # You could, for example, wait for a week: secsinweek = 7 * 24 * 60 * 60 time.sleep(secsinweek) # Use the following to stop auto-responding