About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
See full specifications

linux default icontweetstream Publisher's description

Simple Twitter streaming API access

tweetstream is a Python module that provides a single class, TweetStream, that can be used to get tweets from Twitter's streaming API. An instance of the class can be used as an iterator. In addition to fetching tweets, the object keeps track of the number of tweets collected and the rate at which tweets are received.

Twitter's documentation about the streaming API can be found here: http://apiwiki.twitter.com/Streaming-API-Documentation .

Note that the API is blocking. If for some reason data is not immediatly available, calls will block until enough data is available to yield a tweet.


Printing all incomming tweets:

>>> stream = tweetstream.TweetStream("username", "password")
>>> for tweet in stream:
... print tweet

The stream object can also be used as a context, as in this example that prints the author for each tweet as well as the tweet count and rate:

>>> with tweetstream.TweetStream("username", "password") as stream
... for tweet in stream:
... print "Got tweet from %-16s ( tweet %d, rate %.1f tweets/sec)" % (
... tweet["user"]["screen_name"], stream.count, stream.rate )

Simple tweet fetcher that sends tweets to an AMQP message server using carrot:

>>> from carrot.messaging import Publisher
>>> from carrot.connection import AMQPConnection
>>> from tweetstream import TweetStream
>>> amqpconn = AMQPConnection(hostname="localhost", port=5672,
... userid="test", password="test",
... vhost="test")
>>> publisher = Publisher(connection=amqpconn,
... exchange="tweets", routing_key="stream")
>>> with TweetStream("username", "password") as stream:
... for tweet in stream:
... publisher.send(tweet)
>>> publisher.close()


System Requirements:

В· Python
Program Release Status:
Program Install Support: Install and Uninstall

tweetstream Tags:

Click on a tag to find related softwares

Is tweetstream your software?

Manage your software

Most Popular

linux default icon GDB 7.4
GDB, the GNU Project debugger, allows you to see what is going on `inside' another program while it... Read more
linux default icon Coral 0.9.1
Coral is a tool and a development platform to create and transform models and modeling languages.
linux default icon Forum Paid Plus Script 6.1
Forum Paid Pay Per Post Exchange is targeted at forum owners who wish to...
linux default icon sdo 0.6.5
Converts oracle SDO_GEOMETRY objects to WKT and GeoJSON.
linux default icon Get Paid Plus Script 6.1
Get Paid Plus Script

Related Category

» Other (877)
» Tools & Editors (359)
» Web Development (146)