Guest User

Untitled

a guest
May 27th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import twitter
  2.  
  3. client=twitter.Api()
  4.  
  5. def view_status ():
  6. username= raw_input('Enter the username:')
  7. latest=client.GetUserTimeline(username)
  8. print [s.text for s in latest]
  9. def update_status ():
  10. username= raw_input('Enter the username:')
  11. password=raw_input('Enter the password:')
  12. status=raw_input('Enter the status to be set:')
  13. client=twitter.Api(username,password)
  14. client.PostUpdate(status)
  15. print 'Status Updated!'
  16. def recent_tweets ():
  17. latest=client.GetPublicTimeline()
  18. print [s.text for s in latest]
  19.  
  20. print '1.View status messages'
  21. print '2.Update status'
  22. print '3.View recent tweets'
  23. print '4.Exit'
  24.  
  25. takeaction = {
  26. "1": view_status,
  27. "2": update_status,
  28. "3": recent_tweets,
  29. "4": exit,
  30. }
  31. while True :
  32. choice = raw_input("Please enter your choice... ")
  33. takeaction.get(choice)()
Add Comment
Please, Sign In to add comment