Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
from twython import Twython
import linecache
import os
import sys
HOME = os.path.expanduser('~/')
passfile= HOME + '.passfile.text'
APP_KEY = linecache.getline(passfile,1).strip()
APP_SECRET = linecache.getline(passfile,2).strip()
OAUTH_TOKEN = linecache.getline(passfile,3).strip()
OAUTH_TOKEN_SECRET = linecache.getline(passfile,4).strip()
twitter = Twython(APP_KEY, APP_SECRET)
auth = twitter.get_authentication_tokens()
print(auth)
twitter = Twython(APP_KEY, APP_SECRET,
OAUTH_TOKEN, OAUTH_TOKEN_SECRET)
credentials = twitter.verify_credentials()
#print(credentials['profile_image_url'])
tweet = sys.argv[1] + " | #Twython"
#twitter.update_status(status='See how easy using #Twython is!')
## debug:
print(tweet)
# it's a good idea to measure the length
# of the string before tweeting
# update twitter status with a actual tweet
twitter.update_status(status=tweet)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment