Pre-requesites: Python already installed on the box.
$ sudo easy_install twython
$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
>>> from twython import Twython
>>> twitter = Twython()
>>> results = twitter.searchTwitter(q="NASA", rpp='10')
>>> for tweet in results['results']:
... print "User: %s \n Tweet: %s" % (tweet['from_user'], tweet['text'])
...
User: CarlaEid
Tweet: Reading: http://t.co/1Rlpmr0 #Arabic #NASA
User: raccoonTweetzz
Tweet: If NASA sends a pregnant woman into space and gives birth...is the baby an alien? (•͡.̮ •͡ )
User: JHarley36
Tweet: @PrettyMoneyPaid I've been working for NASA.
User: chrome_ghost
Tweet: 9.11 as seen by the only american not on earth at the time. http://t.co/SInyMAh
User: sebargue
Tweet: RT @monterocnn: Así se vieron ataques contra Nueva York desde el espacio. Video: http://t.co/x0BB9tm
User: supermorgy
Tweet: @mariefrance16 Nasa work ako Marie. Downtime kami. Kaya nag hahabol productivity. Will watch it with honnie on Saturday!
User: bongiss
Tweet: @Lalalishh nasa new york ka? Haha
User: UNIVERSITAM
Tweet: UNIVERSITAM: LA NASA LANZA LAS SONDAS GRAIL CON DESTINO A LA LUNA http://t.co/ebBGucY
User: taroshaw
Tweet: RT @Mrkat0: NASAの人工衛星落下へ 重さ6トン、月末にも http://t.co/lKXubuz
ジョー、君はどこに落ちたい…?
User: hugonz
Tweet: Y no, la NASA no cuenta. RT @circulobastiat: "Los grandes avances de la civilización jamás han venido deun gobierno central" Milton Friedman
>>>
No comments:
Post a Comment