News for hackers. Stuff that matters.
Re:TwitTornado: Real-time Twitter using Tornado by paul on Thursday September 17, 2009 @02:42AM (#827561)
You should be able to get near-instant updates by using Twitter's streaming API: http://apiwiki.twitter.com/Streaming-API-Documentation#statu...

I just updated Tornado's httpclient to include a streaming_callback parameter which allows you to process data as it arrives (the param was somehow lost when httpclient was extracted from the FriendFeed code).

To use it, just do something like:

    http_client.fetch("http://stream.twitter.com/1/statuses/filter.json?follow=IDS...,
       cb, streaming_callback=self._handle_data, auth_username=...)

    def _handle_data(self, data):
        lines = (self.prev_linepart + data).split("\n")
        self.prev_linepart = lines[-1]
        lines = lines[:-1]
        if not lines:
            return

        for t in lines:
            try:
                tweet = tornado.escape.json_decode(t)
Re:TwitTornado: Real-time Twitter using Tornado by thingsilearned on Thursday September 17, 2009 @04:21PM (#828856)
Awesome! I'll try to integrate this soon.