title: Python - Twitter bot that retweets based on 'x' number of retweets
body: <p>so I'm working on my first ever code for a simple Twitter bot that retweets based on hashtags. What I want to do is add a bit of code which will still allow the bot to retweet tweets that have one the hashtags specified but also ensure that the tweets have an X number of retweets already, to stop the bot tweeting small personal accounts that have little to no interactions.</p>
  
  <p>Here is the code I've got so far which is working, just retweeting everyone and anyone that uses one of the hashtags:</p>
  
  <pre><code>import tweepy
  
  from time import sleep
  
  from keys import *
  
  auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
  
  auth.set_access_token(access_token, access_token_secret)
  
  api = tweepy.API(auth)
  
  
  for tweet in tweepy.Cursor(api.search, q='#bcafc OR #hcafc OR #rufc OR #lufc OR #mot OR #alaw OR #twitterblades OR #sufc OR #forgedinsteel OR #swfc OR #swfcLIVE OR #notjustagame OR #youreds OR #utb OR #boro OR #htafc OR #drfc').items():
  
  try:
  
      print('\Yorkshire Footy Bot found tweet by @' + tweet.user.screen_name + '. ' + 'Attempting to retweet.')
  
  
      tweet.retweet()
  
  
      print('Retweet published successfully.')
  
  
      sleep(20)
  
  
  except tweepy.TweepError as error:
  
      print('\nError. Retweet not successful. Reason: ')
  
      print(error.reason)
  
  
  except StopIteration:
  
      break
  </code></pre>
  
  <p>If there is no way to do this would it be possible to only retweet from accounts the bot follows? Even that would help limit the random tweets it's sending out.</p>