Twitter from Terminal: Python
This literary took 10 minutes of my time. I used the simplest form of code writing (if…then).
You have get the tweepy library
mytime = my timeline
@ = mentions
ptime = public timeline
Ufolo = User followers
Update = tweet
kill = kill
*note: There are some issues..This is not a complete product…Hope you enjoy
Code starts here \|/
import tweepy
CONSUMER_KEY = ‘YOUR CONSUMER_KEY’
CONSUMER_SECRET = ‘YOUR CONSUMER_SECRET’
ACCESS_KEY = ‘YOUR ACCESS_KEY’
ACCESS_SECRET = ‘YOUR ACCESS_SECRET’
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)
auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)
api = tweepy.API(auth)
while 1:
x=raw_input(“»”)
if x==”mytime”:
user_tweets = api.user_timeline()
for tweet in user_tweets:
print tweet.text
elif x==”@”:
mentions = api.mentions()
for mention in mentions:
print mention.text
elif x==”ptime”:
public_tweets = api.home_timeline()
for ptweet in public_tweets:
print ptweet.text
elif x==”Ufolo”:
f = raw_input(“ID: “)
folo_name = [u.screen_name for u in api.followers(f)]
for tfolo in folo_name:
print tfolo
elif x==”update”:
y = raw_input(“Tweet: “)
tweet = api.update_status(y)
elif x==”kill”:
print “goodbye…”
break
else:
print “usage: mytime,@, ptime, me, Ufolo, update, kill”



![go2n:
upgrade KDE dari 4.6.95 ke 4.7.0 via [testing] repo](http://25.media.tumblr.com/tumblr_lp108rVIUH1qb8fn1o1_500.png)