After the tragic death of Ernest Marples, I’m sorry to say that the site fell in to a bit of disrepair. With no postcode data and no new boundary data, it looked like VoteUK was going to be permanantly out of business.
Thanks – once again – to the clever-clogs at TheyWorkForYou, at least half of the problem has been solved.
The API call getConstituency now has a future parameter. Adding future=1 to the call will return the constituency the Postcode will be in for the 2010 General Election.
I’ve also made use of TWFY’s getMP API call. It returns enough detail about the current MP to be useful – including a photo.
So, a valid postcode will get you something like this:
One thing to note about the photos. Each one is a different size. This gives us two small problems.
Firstly there is no guarantee of how small the photo is. Should one MP’s photo be massive, that could cause a problem for the phone trying to download it. All the ones I’ve tried so far have been thumbnail size.
Secondly, because we don’t know the height and width of the image, we can’t put the height and width attributes in the <img> tag. Not only is this poor HTML, but it will mean that rendering the page will take longer and – depending on the phone – page reflow may occur.
To mitigate this issue, I’m using http://tinysrc.mobi/ – it will automatically shrink the picture to fit the phone. This doesn’t help with the page reflow issue though.
As for geo-locating Postcodes – I suggest you respond to Ordnance Survey’s consultation and / or lobby your MP.
Until there’s an official source for postcode data, I’ve gone back to using Yahoo!’s geo-location API. I then pass these co-ordinates on to the Google Maps API.
So, VoteUK lives on. Next steps are to make sure that all the data I got from the Electoral Commission is valid and build a framework for volunteers to enter their local candidate details.