Skip to content

Instantly share code, notes, and snippets.

@PiotrKrosniak
Created April 16, 2018 15:00
Show Gist options
  • Save PiotrKrosniak/e062f37bdb951f0de1e99a59b0c9c64c to your computer and use it in GitHub Desktop.
Save PiotrKrosniak/e062f37bdb951f0de1e99a59b0c9c64c to your computer and use it in GitHub Desktop.
import tweepy
from time import sleep
from credentials import *
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
user_profile = api.user_timeline(screen_name = 'NAME', count = 1, include_rts = False)
def tweet():
for status in user_profile:
try:
api.retweet(status.id)
except tweepy.TweepError as e:
print(e.reason)
tweet()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment