Library loans and Goodreads

Goodreads has a yearly Reading Challenge, which compares books read within a year to your previously stated target. The hard part is not reading the book though, its updating the Goodreads data.

Recently Goodreads added the ability to import books from your Amazon account, which helps. However there is no support for library loans, presumably because there's so much library software to choose from.

I've just been having "fun" sorting it out for my local library, which uses "Prism" software written by Capita. I love that the library now has online software which not only shows me what I have on loan and allows me to renew them, it also has the history of all the books I've borrowed, and when I returned them. As a bonus, the loan and history data is nicely structured, so fetching it was straight-forward using WWW::Mechanize.

The fun part comes with using the Goodreads API to add the books to my account. First, OAuth (v1)... the less said there the better! (Luckily Net::OAuth exists!). Next, struggle with the sparsely (and sometimes incorrectly) documented API itself.

Eventually I made it work, its not pretty though! Maybe I'll improve it later.. After wondering if there wasn't a standard way of defining APIs that one could easily create Perl modules from, I came across Swagger. Maybe I'll write one for Goodreads..

Readers of Perl code can amuse themselves over the results on Github: Prism::API and script, GoodReads API