Our books are all over the place – bookshelves all over the house with mixed up contents, and loads in cardboard boxes too (we moved house only 11 years ago). not surprisingly, it’s rather hard to find that book I’m sure I’ve got somewhere about Greek mythology, or whatever. So as a masterclass in displacement activity (from DIY and real work) I set up an Access database to catalogue all of our books.
After entering about 3 books it became apparent that this was a pretty boring activity, and my idea of getting the kids to do it was not well received even by Lois. So I hunted around for a web service that could do it for me with minimal effort. I found isbndb.com and all my troubles were over. I’ve added a magic button to my data entry form to fetch data from the ISDBdb web service - all you have to enter is the 10-digit ISBN code, and the other fields are magically filled in for you.
It’s quite a powerful API, allowing searching in a variety of ways and returning data about books, authors, subjects etc. For the moment I’m only using a simple ISBN look-up in an XMLHTTP request, where the request looks like this: http://isbndb.com/api/books.xml?access_key=WJIH83BE&index1=isbn&value1=0500276056&results=details,texts,subjects,authors
returning XML data like this:
<BookList total_results="1" page_size="10" page_number="1" shown_results="1">
<BookData book_id="archaeology_a33" isbn="0500276056" isbn13="9780500276051">
<TitleLong>Archaeology: theories, methods, and practice</TitleLong>
<AuthorsText>Colin Renfrew, Paul Bahn</AuthorsText>
<PublisherText publisher_id="thames_and_hudson">New York : Thames and Hudson, c1991.</PublisherText>
<Details change_time="2005-03-31T08:09:28Z" price_time="2011-12-31T01:26:57Z" edition_info="" language="eng" physical_description_text="543 p. : ill. (some col.)" lcc_number="CC165" dewey_decimal_normalized="" dewey_decimal="" />
<Notes>Includes bibliographical references (p. 493-524) and index.</Notes>
<Person person_id="renfrew_colin">Renfrew, Colin</Person>
<Person person_id="bahn_paul_g">Bahn, Paul G.</Person>
So it was a relatively simple matter to parse this XML (using MSXML) and bung the values into the right places. Actually it is not completely simple, because the data from the web service is rather variable, and doesn’t correspond directly with my data structure; for example, you can see from the example above that the PublisherText node contains a string that I would consider the publisher, publishing location, and publishing date, all mashed up together – slightly disappointing from a supposedly structured database. But hey it’s pretty good, and the result is we can now enter a new book in a few seconds.