New site launch

I’ve just completed a new site for the Edinburgh publisher Canongate to promote their Life of Pi Readalong. They’re trying to get 31,400 or so people reading Yann Martel’s Booker Prize-winner in August, and the site exists to get people signed up.
It’s based on the Wordpress content management system with some cool plugins for things like the comment wall and video player on the front page. Wordpress has really come of age recently, and the range of plugins means that it is an extremely versatile and extensible system. Some of the most useful, though, just make marginal adjustments, like restoring images to excerpts of posts: normally Wordpress strips them out, but that made for a bit of a text-heavy page.
We used Mailchimp to manage the mailing list: signups are sent to Mailchimp and then data about the list is retrieved to show who has signed up and how many are going to be part of the Readalong. The Mailchimp API is pretty easy to use, although we had to modify a few things to speed it up.
We started by using the Mailchimp database directly, so every time we needed to get the list of readers, we’d ask Mailchimp for it. Sometimes this worked okay, but a lot of the time it was slooooow and sometimes it would just time out and fail. Not ideal. So, wary of duplicating data and getting out of sync, we looked into keeping a local copy of the Mailchimp list. Running a cron job every ten minutes or so and getting a fresh copy was the first option, but it’s a bit brutal and when the numbers get large, rather a strain on bandwidth. Thankfully, Mailchimp themselves came up with the solution: webhooks. These are functions that can be invoked by developers when a particular event happens, and the results are sent to a specified URL. In our case, subscriptions and unsubscriptions trigger POST requests to a page on the Life of Pi site that uses the data in functions to insert or delete records in the database. Not much fun to test, but now it’s up and running, it works beautifully and we’re all synced up.
Anyway, the counter is ticking along nicely, so let’s hope they pass their target. I have to say I wasn’t sure about the novel when I read it, but there’s some good background and critical analysis on the site that has persuaded me to give it another look…


