Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)()
Add Comment
Please, Sign In to add comment