My latest mashup: on Westminster and web services

MP mapI’ve been experimenting a bit more with Ajax, XML and all that good stuff… and have come up with a Google Map of all UK MPs. Each constituency is shown as a marker on the map, grouped by the usual UK government regions to make it a bit more manageable. Click on a marker, and you’ll get the usual Google popup window, telling you who the MP is, which party they’re from… and what they’ve been up to recently. Technically, it’s much the same as last week’s football news mashup. The coordinates for each marker are stored locally in XML files, and all the data is brought in dynamically via ajax (as XML or RSS) when the marker is clicked.
The magic ingredient is the use of the web services API offered by TheyWorkForYou. If you’ve never seen the site before, it takes the official record of proceedings in the House of Commons (Hansard) and turns it from this into this. That’s clever enough in itself, but they go one step further – by offering much of the information for consumption by other websites, in the form of data feeds (including XML). What this means, in practice, is that my humble little map doesn’t know who the individual MP is… but it knows how to ask TheyWorkForYou, and how to process the response. Think of it as cross-site content management: writing once, using many times, even on different websites.
With more than a decade of e-government experience behind me, the recurring thought in my mind is: I’ve thrown this together in a matter of a couple of days. How long would it have taken, how many levels of management would I have had to sweet-talk, and how much would it have cost, to do this inside the public sector? And deep down, I know the answer is that more likely than not, it simply couldn’t happen.
Depressingly, I’m wondering if e-government should throw in the towel, and shift its focus from producing websites to producing web services. In other words, create databases visible to the outside world, and let others do the presentation. Lots of tailored front-ends for different audiences and different uses, all running off the same authoritative data source. I bet we would end up with a better appreciation for the data, and better application of it… which, ultimately, meets government’s objective.

6 thoughts on “My latest mashup: on Westminster and web services”

  1. Simon
    I like the mashap! (as I’ve said before). The idea of government shifting to providing web services (or at least routinely providing them) is intriguing too.
    Two thoughts/questions:
    1. What standards to comply to. I had a quick look at the TheyWorkForYou site, and as far as I can see, the XML that’s generated is a format they invented themselves – I’m not even sure there’s a DTD? I don’t know enough XML to know if there’s an exzisting standard that could be adapted for the sort of informaiton that TWFY collates?
    Or do you think that at the moment, it’s best to press on, and see what can be done?
    My concern would be that if a series of overlapping or inconsistent ways for exposing data arises, there would come a point where it all gets too messy to manage anymore.
    2. What about feeding information back into the system (or getting feedback from it)? Getting information out is a great start, and it does look like TWFY-type approaches are the quickest way to get things done.
    But it would be an interesting challenge to design a system to support feedback while supporting the democratic institutions, or at least managing the impact in a constructive way – more a political than an information systems issue I think?
    But maybe that’s where the political institutions effort should be aimed, rather than attempting to build entire websites – I guess that’s what you’re saying?
    Have you read the Bill Thompson article on Web 2.0? It seems to have caught a lot of people’s imagination (and criticisom).
    PS Sorry about the broken link in the trackback above. It should be to here.

  2. Peter: the problem, as I’m sure you’ll guess, is that any talk of ‘standards’ will lead to a process of standardisation. Or worse, a committee to propose and maintain a standard – and that will kill it stone dead.
    You’re absolutely right: TWFY doesn’t use any kind of XML standard, and even then, they could have made things quite a bit easier. There are problems familiar to any XML work, like ampersands and accents (yes, I’m looking at you, Ynys Môn). I had to make up the coordinates for the Northern Ireland constituencies myself. Plus, I’ve had to string together two or three API calls to get relatively simple information out.
    But that’s nit-picking. It’s there, and it works. I’m no XML expert, and if I can do this, then anyone claiming any depth of knowledge should be able to do so too. Inconsistent approaches might be a problem in the longer term… but if it becomes a worry in the future, we will have reached a much better place than we are at today.

  3. I agree totally with SimonD’s comment on reaching a much better place – getting the data out there, machine readable, is much more important. And a point of the API was you don’t have to use XML, which frankly I don’t like much, you can use whatever’s best for you (or ask us if it’s missing 🙂 ).
    “[TWFY] could have made things quite a bit easier.”
    It’s hard to improve the API if you don’t send us your feedback. 🙂 I see the accent problem – our XML is currently outputting in ISO-8859-1 and it should say that in the PI, hang on… fixed.
    “Plus, I’ve had to string together two or three API calls to get relatively simple information out.”
    I presume what’s missing for you is a getHansard function? I’m not sure why I didn’t have one of those, if I had a reason I’ve forgotten it. Anyway, do send an email with your complaints, suggestions, and so on.

Comments are closed.