Have you seen the rather lovely Library Thing website?

For book lovers it provides a great way of finding information about books, about what other people like, and what you might like. It also lets you host a list of your books, letting you see and search amongst them, even showing their covers in its ‘bookshelf’ view. Here’s our library. (It also has some widgets for bloggers, and that’s how you can see a few books in the right hand column of this one.)

It also has discussion forums around particular books, authors and the like. On it some people have committed to reading and reviewing 50 books this year. Martha’s taken up the challenge, and has started here. Why don’t you put some of your books up? We’d love to be able to discuss books or authors we have in common?

**’Tis done :-)** I have finished the upload to [LibraryThing](www.librarything.com). Visit our profile, or the view of the books more directly at our catalog. Now the book covers on the right hand side of the blog should show something, as they’re fed by LT as well. Tres nifty!

Argh, but it took a long time to finish off the code, as I was banging my head against this

> Maximum execution time of 30 seconds exceeded

error for several hours. Turns out to be a PHP script limitation, not a cURL POST timeout thing. A quick set_time_limit() call later, and all was well.

I’m pleased with myself. For a long time I’ve been wanting to get our library of books uploaded onto www.librarything.com, partly because it looks like a good 3rd party service offering that is going to do a better job than I am, and partly because it can show your books as collections of covers.
LibraryThing logo
The downside is that they don’t have an API (programmatic interface) to add lots of books that I can use. They do have an import form where you can add multiple ISBNs in one go, but I haven’t yet got the ISBNs for quite a lot of our books, and for some that I do have the ISBNs don’t turn up in Amazon or their other sources of info.

So I decided to write some PHP to poke the existing “advanced manual add” form with the contents of my book list, held in XML.

Last night I got the POST operation working, after much more effort than I was expecting. Turns out the documentation for the various PHP libraries that deal with HTTP POST operations aren’t as good as I’d like - particularly the PEAR one. In the end I went with cURL, which then took an age to install properly as you have to do odd things with libssl32.dll and libeay32.dll and the windows/system32 directory. Grr. Turns out I needed to have cookie authentication turned on, but otherwise it was fairly straightforward once I figured out the http_build_query function.

Anyway, I’m writing the rest of the code today, so its not yet finished, but the results should be available at our profile - or the view of the books more directly at our catalog (sic).

Welcome to my blog site -- here to help me work out what I think. Feel free to join in, and start a debate. Cheers -- Jonathan.