Beautiful hackery

While I had Matthew in my clutches, I made him show me around the API for They Work For You. Who knew that so much could fun be derived from data about MPs?

First off, there’s Matthew’s game of MP Top Trumps, ‘though he had to call it MP Fab Farts to avoid getting a cease and desist letter.

Then there’s a text adventure built on the API. This is so good! Enter your postcode and you find yourself playing the part of your parliamentary representative with zero experience points and one hundred hit points. You must work your way across the country, doing battle with rival MPs, as you make your way towards Sedgefield, the lair of Blair.

You can play a Web version but for some real old-school fun, try the telnet version. This reminded me of how much I used to love text adventures back in the days of 8-bit computers. I even remember trying to write my own in BASIC.

For what it’s worth, Celia Barlow, MP for Hove, has excellent pesteredness points. I made it all the way up to Sedgefield and defeated Tony Blair in battle. My prize was the source code of the adventure game in Python.

Ah, what larks!

There’s another project that Matthew works on that I find extremely useful. He has created accessible UK train timetables using the data from the National Rail site, a scrAPI if you will. This is where I go whenever I need to plan a train journey.

The latest feature is something that warms the cockles of my heart: beautiful, hackable URLs. If I want a list of trains going from Brighton to London, I can just type:

It handles spaces (or pluses or underscores) too: victoria

The URL can also be extended with a departure time: victoria/14:00

My address bar is my command line. This is the kind of design that makes URL fetishists like Tom very happy.

Have you published a response to this? :


Andy Budd

Surely MP Top Chumps would have been better?

# Posted by Andy Budd on Sunday, October 29th, 2006 at 8:37pm

Tom Armitage

Nice as the functionality is, I wouldn’t go as far as “beautiful, hackable URLs”.

Simple reason, really: they don’t represent what’s going on (IMHO).

/brighton/london/victoria is fine, I guess. /brighton/london/victoria/14:00 makes a lot of sense - it’s adding an extra query (the time) to the URL, further refining the results. Drilling down.

So if I drill back up - /brighton - I should just get every departure from Brighton, right?

But you get a 404. Now, we both know it’s a limitation of the original site being scraped that leads to this. But that’s part of the ultimate goal - a URL wherein each parent part can stand alone.

The slashes indicate a form of hierarchy. As it stands, the less-attractive - but more semantically accurate - /brighton&to=london_victoria has a few advantages. Notably: it’s one atomic unit, which is how the available interface represents things.

It’s a great service, and I like this improvement (mainly because I like typing URLs by hand) but the attractive URLs available aren’t quite perfect yet.

simon r jones

i’d have to agree wholeheartedly that hackable urls are a good thing. We’re soon to launch a music sector website that we’re ensuring has nice URLs you can change to pick up various different searches. Not only does it increase usability it’s also great for search engines (the main way I sold it to the client). We’re also considering the same idea to allow users to generate their own RSS feeds based on search preferences

The accessible train times site is indeed great. We have an vaugely related internal project called developed quite a while ago which offers a simple search for the London tube. Inspired, I had a quick go at adding hackable URLs just now which has resulted in: and

Previously on this day

14 years ago I wrote Flickrism

Back in July, a Flickr member posted a photoset of a commercial he was working on. The spot involved the release of 250,000 superballs down a hill in San Francisco. Other Flickrites also documented the release.

15 years ago I wrote Anger is an energy

Last year BBC Radio One came to Brighton and organised a week of live music. This year, there’s no sign of auntie Beeb but local promoters have organised a week of music anyway.

17 years ago I wrote Apple - iMac

The deed is done. I just placed an order at the Apple store for a 17 inch iMac.