Skip to content

Instantly share code, notes, and snippets.

@russelnickson
Created June 7, 2010 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russelnickson/428961 to your computer and use it in GitHub Desktop.
Save russelnickson/428961 to your computer and use it in GitHub Desktop.
import twitter
client=twitter.Api()
def view_status ():
username= raw_input('Enter the username:')
latest=client.GetUserTimeline(username)
print [s.text for s in latest]
def update_status ():
username= raw_input('Enter the username:')
password=raw_input('Enter the password:')
status=raw_input('Enter the status to be set:')
client=twitter.Api(username,password)
client.PostUpdate(status)
print 'Status Updated!'
def recent_tweets ():
latest=client.GetPublicTimeline()
print [s.text for s in latest]
print '1.View status messages'
print '2.Update status'
print '3.View recent tweets'
print '4.Exit'
takeaction = {
"1": view_status,
"2": update_status,
"3": recent_tweets,
"4": exit,
}
while True :
choice = raw_input("Please enter your choice... ")
takeaction.get(choice)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment