wcm tweet update
This is a python script to update twitter that wcmckee.com has been updated.
In [9]:
import tweepy
import sys
In [10]:
opconkey = open('/home/wcmckee/twconkey.txt', 'r')
conkeys = opconkey.read().strip('\n')
opconsec = open('/home/wcmckee/twconsec.txt', 'r')
consecs = opconsec.read().strip('\n')
opacckey = open('/home/wcmckee/twacckey.txt', 'r')
acckeys = opacckey.read().strip('\n')
opaccsec = open('/home/wcmckee/twaccsec.txt', 'r')
accsecs = opaccsec.read().strip('\n')
In [10]:
In [13]:
#argfile = str(sys.argv[1])
#enter the corresponding information from your Twitter application:
#conskey = '1234abcd...'#keep the quotes, replace this with your consumer key
#consec = '1234abcd...'#keep the quotes, replace this with your consumer secret key
#acckey = '1234abcd...'#keep the quotes, replace this with your access token
#accsec = '1234abcd...'#keep the quotes, replace this with your access token secret
auth = tweepy.OAuthHandler(conkeys, consecs)
auth.set_access_token(acckeys, accsecs)
api = tweepy.API(auth)
update = ('this is an update')
api.update_status(update)
In [14]:
my_str = "hello world"
bytes = str.encode(my_str)
type(bytes) # insures its bytes
my_decoded_str = str.decode(bytes)
type(my_decoded_str) # insures its string
Out[14]:
In [ ]: