Skip to content

Instantly share code, notes, and snippets.

@benrules2
Created November 3, 2016 01:03
Show Gist options
  • Select an option

  • Save benrules2/b1f219510400a3eff480184f5707477e to your computer and use it in GitHub Desktop.

Select an option

Save benrules2/b1f219510400a3eff480184f5707477e to your computer and use it in GitHub Desktop.
Run main loop for Mirror Bot
if __name__ == "__main__":
twitter_account = authorize_account()
since = 1
while(True):
#read all mentions since we last checked
tweets = read_messages(twitter_account, since)
since = tweets['since_id']
#iterate through messages, updating status
for message in tweets['messages']:
twitter_account.update_status(message[::-1])
#sleep 15 minutes and check again
time.sleep(60 * 15)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment