Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tweepy
- import sys
- while True:
- line = raw_input("> ")
- tokens = line.split()
- if not tokens:
- continue
- command = tokens[0]
- if command == "public":
- public_tweets = tweepy.api.public_timeline()
- for t in public_tweets:
- print t.text
- elif command == "trends":
- print "GET YOUR OWN TRENDS"
- # Get trends, print them out
- elif command == "user":
- username = tokens[1]
- print tweepy.api.get_user(username)
- elif command == "q":
- sys.exit()
- else:
- pass
Add Comment
Please, Sign In to add comment