It’s the BBC Mashed hack session this coming weekend, so I suppose lots of people are trying to think of a project to work on. I have an idea that involves UK political web sites.
I expect that most MPs have a web site. A far smaller number of them have a blog. Some of them use blog-like software to publish news and other similar web feeds. Part of what I want to do is to build a directory of those URLs. I can’t see any way to do this other than trying to track down each of the 646 MPs on the web and poking around on their sites to find all of the interesting URLs. I’m hoping I can get some help with that.
But there are also sites about MPs that are run by other organisations. These ones are easier to track down. For example, They Work For You has a page for every MP. The page for my MP is
So that looks easy enough. You just use the name of the MP and the name of the constituency. Public Whip has a similar mechanism. My MP’s page on Public Whip is
Then there are the news organisations. The BBC has a page about my MP. It’s at
In this case there’s a magic number (35) and in order to construct these URLs for other MPs, you’d need to map these numbers to MPs (or constituencies).
The Guardian has two pages. One for the MP and one for the constituency.
Again, each of those contain magic numbers that you’d need to get a complete list of. And I assume (or, at least, hope) that these pages will one day be given shiny new URLs like other parts of the Guardian site.
It’s this second part of the problem that I want to concentrate on first. Building URLs to external sites pro grammatically. And this is where you, gentle reader, can help me. I have two questions that you might be able to answer.
- I’m sure I’m missing some external sites. To be honest, I haven’t really looked very hard yet. I’d be surprised if some of the other national papers didn’t have similar pages to the Guardian. Do you know of any other good sites that have pages dedicated to each individual MP or constituency?
- Do any of you work for organisations that publish these pages? If so, is there any chance that you could sent me lists of the “magic numbers” that appear in your URLs? What I’d need is something like a CSV file (or whatever format is convenient for you) that maps your magic numbers to a recognisable name for an MP or a constituency. I can then map your data to my list of MPs. I know it’s a bit cheeky, but it doesn’t hurt to ask.
There’s still one part of the puzzle missing. A surprising number of people don’t know the name their MP or even their constituency. So an important part of the system will be a search engine. At the very least, I’ll need the ability to convert a postcode to a constituency (or MP). All of the sites I mentioned above do this. It would be great if one of them made the look-up available as a web service.
Of, and one last thing. If you’re going to Mashed and don’t have a project to work on and this sounds interesting to you, then please get in touch. Feel free to link up with me on the backnetwork site.
Update: If you listen, you can probably hear the sounds of my kicking myself very hard because I forgot to check the They Work For You API before writing this entry. It does a lot of the kinds of things that I will need. There’s even a Perl module – which makes me very happy.