Skip to content

Instantly share code, notes, and snippets.

@wgwz
Created June 9, 2017 21:02
Show Gist options
  • Save wgwz/27dc43f1e3d1d652d85a32f32530c3fa to your computer and use it in GitHub Desktop.
Save wgwz/27dc43f1e3d1d652d85a32f32530c3fa to your computer and use it in GitHub Desktop.
import tweepy

exec(open('/etc/environment').read())
bot_username = 'RyeArtsCodingC'

def tweet(text):

    auth = tweepy.OAuthHandler(C_KEY, C_SECRET)
    auth.set_access_token(A_TOKEN, A_TOKEN_SECRET)
    api = tweepy.API(auth)

    try:
        api.update_status(text)
    except tweepy.error.TweepError as e:
        print(e)
    else:
        print("Tweeted: " + text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment