Tracking Heathrow with twitter

It's 11.23 on Thursday

A few months back—while we were discussing the number of talking objects appearing on twitter—Jenny pointed out to me that all Heathrow airport arrivals and departures data is online. That set my mind racing, as if you know all the flights leaving that currently controversial airport, there are all manner of things you could begin to do. Working out miles travelled and carbon emitted, spotting delays, and so on. But at the time it all came down to a quick note in Things to some day set aside time to explore.

That day arrived this week. The data turned out to be pretty simple to scrape, with a quick wrapper around hpricot, and to throw into an SQLite database using datamapper to give me a little abstraction and a place to throw a variety of methods to make my code simpler. And then it was a small matter of employing John Nunemaker’s twitter gem to set up regular tweets letting followers in on how many flights in and out of Heathrow there have been lately.

The result is a rather pleasing hourly summary, that adds a little rhythm and background awareness into my day. You can follow it at

Perhaps the biggest frustration with the data is that all destinations/origins are given as city names. Given that city names are hardly unique, and even if they were a given city may have several airports connecting with Heathrow, that makes it a bit trickier to do some of the more sophisticated calculations. My hope is that the flight codes (which are given) can soon be transformed into a list of airport codes, which can then open up a route to more useful and interesting data. (if anyone knows of an existing database that does that mapping, please let me know!)

I’m looking forward to that, but I’m also anticipating the ambient awareness that having the bot running will create. Will the hourly ritual of seeing a sentence or two about Heathrow activity reveal any patterns? If they do, maybe I’ll update the code to make more of those. We’ll see.

For now, please do follow the tower on twitter, tell people about it, send it messages if you spot anything interesting, and feel free to take a look at the code over on github.

Tags: , , , , , , , , , , , , ,


  1. It’s a nice idea, but I’m not sure twitter is the right medium: it’s not sporadic like @towerbridge or @abovelondon. For example, would you be happy changing it so that it doesn’t send messages if there are no flights in or out during the hour you’re concerned with?

    Still, it’s a good way to flush the data into the open, and figuring out flight codes, and hence distances / approximate passenger numbers, would definitely be very interesting.

  2. Thanks Paul.

    I updated the code this morning so that if there haven’t been any flights in the past hour it notes “I’m having a rest” and if there haven’t been any in the past two hours it doesn’t tweet at all.

    I’m considering developing that a little once I’ve got more data so that it can tell whether it’s normal to not have any flights at that time on that day. There are quite a few possibilities that are awaiting a bit more data.

    I tend to like somewhat “rhythmical” tweets. I’m really enjoying David Lynch’s at the moment which happen about once a day, refer to the date and state the weather in LA. There’s something relaxing for me in the way that punctuates an otherwise erratic/sporadic medium like twitter.

    That said, as more data emerges I am open to moving it off twitter and/or adding some other presence. Once I’ve got some mapping of flight codes to airport codes/co-ordinates a fairly obvious step is some sort of map interface, and there’d be other data visualisation options over time.