Interviews, readability and Kindle - My Guardian hack day effort

 by Martin Belam, 7 February 2012

Last week the Guardian held one of our regular hack days, where the developers (and other people in the tech department) get to spend two days putting aside their regular work, and instead concentrate on a project of their choosing. The rules are that basically, you can do what you want, as long as there is potential value to the Guardian.

Guardian Sport - The interviews

The idea of my hack was to make it easier for people to bundle together bits of long-form content from the site and deliver them to a reading device.

All of the content in our CMS is tagged with a variety of metadata. Some of this describes what the content is about, some of it describes what type of content it is. The initial navigation in my hack offers you a choice of the last ten pieces of content the Guardian has published which have been tagged ‘sport’, are of the content type ‘article’, and have the tone ‘interview’. We use ‘tone’ to describe the flavour of an article - for example whether it is news, comment, an obituary, a match report, and so on.

My hack for the Guardian’s recent hack day

My hack - “Guardian Sport - The interviews”

If the user selects an article, then a call is made to the Guardian’s Open Platform Content API to fetch the full text of the article. This is presented in a clean style, hopefully for ease of reading. Regular users of this blog may recognise the layout somewhat. The typographical style is heavily influenced by the reading mode of readability.com.

I used a modified version of Twitter’s Bootstrap HTML/CSS framework for the templates - partly for ease, and partly so it would like the hack that Swells did on the day too. I used Adam Pickering’s Texturetastic Gray from subtlepatterns.com for the background.

I’ve also added one of the widgets from readability.com on the right-hand side of the page. This allows the user to email the article to someone, switch to a printable view, and, crucially, send the article to their Kindle. I’m a big fan of the device, and think the ability to email a document to some.name@kindle.com and have it auto-magically appear on the gadget for offline reading is a compelling piece of functionality.

To make this hack a viable business proposition for the publisher, I’d be interested in investigating whether a micro-payment could be collected from the user at the time they sent the article - a couple of pence or cents per piece. Readability.com do already have a publisher payment programme set-up. In the meantime, the commercial aspect of this hack for Guardian News & Media is that I have embedded a promo spot for our subscription Kindle edition in the footer of every article. You get the interview for free on your Kindle, and gently reminded that you could be getting every interview we do on every topic.

My Hack with embedded Kindle ad

An ad for the Guardian’s Kindle edition is embedded into every interview

I’ve concentrated on sport here, because that was the theme of the hack day, but the ability to switch genres wouldn’t be too hard to add. I can imagine this working particularly well as a way of presenting our film, TV and music interviews, or our large political features.

Thank you

I’ve been doing coding of some sort or another, with long lulls in between, since I was ten or eleven. However, this hack is the first time I’ve produced anything of much complexity powered by Python. I’d like to especially thank Michael Brunton-Spall, who not only does a great job of organising Guardian hack days, but has taken a couple of hours recently to help get me programming again. He has written a very simple set-up package that gets you going using the Guardian API, and was on hand to help me with queries I had during the day.

I think it is a testament to the brilliant work of our technical architecture team in setting up the API that within a couple of hours, in a language I barely know, I’ve got a working prototype on my local machine, pulling in live Guardian content. I had hoped to deploy it on the web so anybody could play with it - but I fell at the final hurdle it getting it uploaded to AppEngine. So now I have a target of what I want to achieve at our next hack day :-)

More hacks

Jonathan Richards, Joanna Geary and myself live blogged the frantic presentations at hack day. Highlights for me included Dan Catt’s drone radio which automatically read out news headlines and generated ambient music to go with them, Jerry Bate’s “Should I watch Match Of The Day or not?”, Andrew Mason’s multi-participatory touchscreen game, and Ivan Codesido’s retro 3D effort. I blogged a little more about hack day yesterday, and hopefully you will also soon see some of them showcased on the Guardian site.

Keep up to date on my new blog