Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (48 sloc) 1.89 KB


This is a simple little Tornado site that uses Redis, Websockets, and long- polling to push tweets to a web browser. It's useful for conferences and events where you want to encourage people to tweet with a certain hashtag.


It's fairly easy to setup after git'ing:

mkvirtualenv --no-site-packages tweetwatcher
pip install -r requirements.txt
python & python

... although you should probably run it behind supervisord or something in production.

It works pretty simply -- the file publishes the incoming tweets from the streaming API to a Redis channel, and the simply keeps the current clients in memory and subscribes to the Redis channel, sending out messages to all the clients as they come in.

This means that you can spin up multiple on different ports and load balance between them behind nginx or something similar. Keep in mind that WebSockets will need access to each "native" Tornado instance.

You (must) override the settings with a file in the main directory. It should look something like this:

import tweetstream
tweetstream.TWITTER_APP_USER = "myTwitterName"
tweetstream.TWITTER_APP_PASSWORD = "myPassword"

    "redis_pub_channel": "myawesomechannel",
    "twitter_url": "/1/statuses/filter.json?track=foobar",
    "port": 8081

You can also set the port with a --port 8888 argument to

Graphics / Look and Feel

Changing the look is as simply as editing the static/style.css file. You can also just swap out the static/logo.png file for your own logo if you are happy with the default color scheme, etc.


I'd love to hear about it if you use this somewhere or if you have any issues or suggestions.


  • Add a cache for reloading, etc.
  • Add a pre-fetch in case of server crashes and restarts