Guest User

Untitled

a guest
Nov 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. import tweepy
  2. import sys
  3.  
  4. while True:
  5. line = raw_input("> ")
  6. tokens = line.split()
  7. if not tokens:
  8. continue
  9. command = tokens[0]
  10.  
  11. if command == "public":
  12. public_tweets = tweepy.api.public_timeline()
  13. for t in public_tweets:
  14. print t.text
  15.  
  16. elif command == "trends":
  17.  
  18. print "GET YOUR OWN TRENDS"
  19. # Get trends, print them out
  20.  
  21. elif command == "user":
  22. username = tokens[1]
  23. print tweepy.api.get_user(username)
  24.  
  25. elif command == "q":
  26. sys.exit()
  27.  
  28. else:
  29. pass
Add Comment
Please, Sign In to add comment