diff --git a/twitterbot_retweet.py b/twitterbot_retweet.py index 2beb7dd..ee62c70 100644 --- a/twitterbot_retweet.py +++ b/twitterbot_retweet.py @@ -1,4 +1,5 @@ import tweepy +import datetime from time import sleep from credentials import * from config import QUERY, FOLLOW, LIKE, SLEEP_TIME @@ -7,22 +8,22 @@ auth.set_access_token(access_token, access_token_secret) api = tweepy.API(auth) -print("Twitter bot which retweets,like tweets and follow users") -print("Bot Settings") -print("Like Tweets :", LIKE) -print("Follow users :", FOLLOW) +print("Twitter bot which retweets,like tweets and follow users") your text +print("Bot Settings") your text +print("Like Tweets :", LIKE) # your text +print("Follow users :", FOLLOW) # your text for tweet in tweepy.Cursor(api.search, q=QUERY).items(): try: print('\nTweet by: @' + tweet.user.screen_name) tweet.retweet() - print('Retweeted the tweet') + print('Retweeted the tweet') your text # Favorite the tweet if LIKE: tweet.favorite() - print('Favorited the tweet') + print('Favorited the tweet') your text # Follow the user who tweeted #check that bot is not already following the user @@ -33,6 +34,12 @@ sleep(SLEEP_TIME) +# create def Bye(): +def Bye(): + print('Bye!') your text + +Bye() Close + except tweepy.TweepError as e: print(e.reason)