Created
June 7, 2010 17:54
-
-
Save russelnickson/428961 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
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