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:

http://traintimes.org.uk/brighton/london

It handles spaces (or pluses or underscores) too:

http://traintimes.org.uk/brighton/london victoria

The URL can also be extended with a departure time:

http://traintimes.org.uk/brighton/london victoria/14:00

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

Sunday, October 29th, 2006 6:36pm

Tagged with

Comments

Surely MP Top Chumps would have been better?

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

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.

# Posted by Tom Armitage on Sunday, October 29th, 2006 at 11:01pm

Ah excellent stuff, that. I’ve been using traintimes.org.uk for some time, but that hackable URL stuff is just beautiful. Also the 3-letter station codes work - here’s my journey home: http://traintimes.org.uk/WAT/NSH/18:15

# Posted by Ben Darlow on Monday, October 30th, 2006 at 10:20am

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 Tubeplanner.com 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: http://tubeplanner.com/search/Kings+Cross/Fulham+Broadway and http://tubeplanner.com/search/Victoria/Oxford+Circus

# Posted by simon r jones on Monday, October 30th, 2006 at 5:01pm

Illustrations

Thanks to the magic of machine tags, you can illustrate this post by tagging a picture on Flickr with:

Related

Magnolia

Find links that I've have tagged with api, scrapi, theyworkforyou, trains, adventure, game, urls, etc. on Magnolia.

Technorati

Is anybody linking to this?

Find out what other people are saying about api, scrapi, theyworkforyou, trains, adventure, game, urls, etc. according to Technorati.

Flickr

Find photos I've tagged with api, scrapi, theyworkforyou, trains, adventure, game, urls, etc. on Flickr.

Find photos that I took on October 29th, 2006.

More information

About this site

Adactio is the online home of , a web developer living and working in Brighton, England.

Customise

If your browser was up to it, you'd be able to
?

This is the plain vanilla look.

Search


Subscribe

RSS is an XML-based format for syndicating website content. I have some feeds that you can subscribe to:

Elsewhere

Adactio Elsewhere has small pieces of me, loosely joined:

You can also find me scattered across these sites:

Bedroll

I had the pleasure of welcoming these people into my home:

Buy my book

Bulletproof Ajax