Twitter Streaming API + SignalR + Google Maps = Powerful Stuff!

I’ve been playing around with a variety of APIs every once in a while. It is great fun to hack around with the enormous amounts of real data that are out there, and it’s always easy to get crazy ideas with it. Whenever you build something, the lack of data often makes it look cheap, unfinished and crappy. With the abundance of APIs and rich data, this is not the case anymore.

So this time I was thinking about a way to map tweets in real time. My idea was, that following live events such as the Tour de France, a concert and football games is always in the hands of the broadcasters, the production company and TV presenters. But they only show a fraction of what’s actually happening.

Imagine all the geo-located images posted to Twitter and Instagram during the Alpe d’huez stage of the Tour de France – real, live images (and video). The most charming part is, that it’s actually coming from real people, that broadcasts their own little view of the events.

****I cracked open a browser, and read the Twitter Streaming API docs, more specifically the Public (filter) stream that lets you add keywords, locations and users to a filter.

Twitter Integration

I didn’t want to write any Twitter API integration code, since there must be so many libraries out there. Unfortunately, support for the streaming API is minimal. TweetSharp did have an implementation, but that is incomplete (you can’t supply search parameters) – so I needed to tear it apart, and hack my own.

As an aside, I’m sad to see that the awesome TweetSharp library is not being actively developed by Daniel Crenna (the creator) – hopefully someone will take over development.

SignalR is awesome!

I remember the days of cometd – real time push notifications to the browser. It was OK, but a mess to get going. SignalR is awesome! Seriously, the code required to push messages directly to the browser is minimal:

The result

Here’s a Vine video showing the hack in action. Notice when I press send on the iPad, how the pin drops onto the Google Map, like instantly! This is extremely powerful!