What did you do in the election, Daddy?

Posted by james on May 6th, 2010

One wondeful thing about the 2010 General Election is that so many great projects have happened online; Francis Irving covers them in a post on the OKFN blog.

I was personally lucky enough to find the time to use these services to build something. I couldn't find election hustings in my area, so I decided to make a site to crowdsource and open up that information properly. Enter QuestionYourCandidates.

The site allows anyone to enter details of hustings in their area, basically, and link to them in a reliable way. It's made from:

  • Rails 2.3.5 - this reminded me how excellent Rails is for rapid development
  • Constituency & candidate data from YourNextMP through their API.
  • Postcode search via the TheyWorkForYou API.

Both these APIs were incredibly easy to use, and because they use canonical names for both constituencies and candidates, it was easy to then link the site across to other services like Democracy Club and The Straight Choice.

The main dilemma while coding I had was whether to have user accounts. I decided against it in the end, just protecting the edit pages with a captcha. User accounts would have just added another layer of complexity, for really no extra functionality or security.

The whole thing took around 6 hours from start to deploy, and I'm pretty proud of it. Unfortunately I did it a bit late to really be useful for this election, but I will try to generalise it to is can continue to be used for future elections. And, as always, it's open source. Code is on Github.

The Carbon Diet goes open source

Posted by james on May 21st, 2009

Well, I finally got round to it. I started developing The Carbon Diet 2 years ago (had the idea 3 years ago!), and it's finally spread it's wings and joined the world of open source.

After I'd been developing it for a few months, it became obvious that it was never going to be a commercial proposition, so it's been my intention to open it up for a very long time now. However, I was putting it off until "after I get it finished", or "after I tidy up the code", or any number of other reasons. Having a small child puts paid to all those plans, so I've finally bitten the bullet and released my dodgy code to the world as it is, warts and all.

The site is built in Rails, but it's pretty creaky. It was originally written in version 1.2 as I was learning, and a lot of the old-style controller and route code is still hanging around, waiting to be improved. I've started, but there is a long way to go to bring it up to a decent standard.

Anyway, if you use the site (or not!) and fancy improving it, now you can. Head on over to github to grab the code and join in. I hope to see you there!