I’ve been playing with Twitter’s new Streaming API over the last few days.

The old XMPP protocol provided your traditional ‘Following’ stream, plus keyword searching with ‘track’.  All of it being delivered in near-real-time (i.e, immediately after the Tweets were sent).

The new Streaming API uses Comet to deliver a similar set of functionality.

I’ve created a prototype client that uses these functions, so that we can experiment with the new API, the plan being to bring that into MahTweets at some point.

There is some interesting behaviour with the API, particularly with regards to following people.  There was a change to the Web API some months ago, where Twitter disabled the ability to see all tweets your friends make. Basicly they set it so that you can ONLY see the Tweets your friends make, if they’re either Open (not replies), or Replies to someone else you follow.

An example might be that you follow Amy and Barry. It might not be such a big deal for you that you don’t see their tweets to Christine  – but if you, Amy and Barry were discussing something – replies to Christine (even in the same conversation) won’t be seen by you.

Well, the new Streaming API changes that – not only does it bring back that old @replies functionality, it also adds an interesting twist.

Under the Streaming API you also see public @replies to anyone you follow. That is: If Christine were replying to Amy or Bob – you’d see those tweets, even though you don’t follow Christine.

There are some restrictions with the API – you need a reasonably fast and stable connection (Dialup, Satellite, or dodgey wireless connections need not apply), you can’t have more than one streaming connection open per account, and you can’t rapidly change the stream settings.  You also need to explicitly define what keywords and user IDs you want to recieve updates for. That’s currently limited to following 400 users, and/or tracking 200 keywords.

Still… it’s a bunch of fun, and can lead to some interesting scenarios.

Here’s a screencap from the demo client. I’m tracking Aeoth’s UID here, but also getting replies to @aeoth

Test Client - Full Follow Stream

Test Client - Full Follow Stream

Comments are closed.