Created
September 22, 2015 12:49
-
-
Save tatic0/1175fbf192f8255c5cc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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