Track keywords on Twitter (tail -f v2.0)
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Track keywords on Twitter, this is the web 2.0 equivalent of tail -f.

It uses OAuth and Twitter's Streaming API to get status in real-time.


$ ./octo-twitter-track sstic alcohol
2012-06-12 18:49:28 @xxx: Nearly missed our stop on the bus for the second time today which can only associated with our lack of sleep/ alcohol intake last night.
$ ./octo-track-twitter alcohol -o /dev/stdout | tee -a alcohol.log
$ ./octo-track-twitter -h
Usage: [options]

     -h, --help            show this help message and exit
     -C TOKEN, --consumer-key=TOKEN
                           Twitter consummer key
     -S TOKEN, --consumer-secret=TOKEN
                           Twitter consummer secret
     -A TOKEN, --access-token=TOKEN
                           Twitter access key
     -K TOKEN, --access-key=TOKEN
                           Twitter access key
     -o FILE, --output=FILE
                           Write output in file
     -v, --verbose         Verbose mode
     -d, --debug           Debug mode
     -t, --track           Tracks keywords in realtime
     -O, --old             Search past tweets (not implemented yet)


$ sudo pip install tweepy

Debian package is too old. You have to use latest version (1.9) available on pypi.

Twitter OAuth credentials

You need to create an application on Twitter Dev board to get consumer and access credentials. Then put these information in ~/.config/octo-track-twitter/ like above:

$ mkdir -p "${HOME}/.config/octo-track-twitter"
$ cat > "${HOME}/.config/octo-track-twitter/"

CONSUMER_KEY="XXX" # obtained from

# access token