Google Books API

Google released an API for their Book Search at the end of last week. You can implement this in two ways: static (just linking to a URL with a ISBN inserted) or dynamic, which basically means using javascript, which will check to see if Google have the book available as the page loads and can show a link accordingly.

The (very rough and basic) ‘catalogue’ I recently created already had a link to Google Books for each item. This was just a very simple URL with an ISBN stuck on the end, e.g. http://books.google.com/books?as_isbn=0596003722

Tonight I have made the first steps in adding links to items using the Google Books API using both the static (simple) and dynamic methods.

You can see an example here http://www.nostuff.org/tdn/6b/item.php?item=0596003722.

You can also do a search via http://www.nostuff.org/tdn/6b/

The layout is currently very rough, and the dynamic search is broken in that it will only show a result for the first ISBN for a given item (I know why but don’t have time to fix now).

I have to confess I know very little javascript. The examples from Google only use a few lines of code but not really understanding what it did, did not help. For example, for the dyanmic display, I found it did not work at all, until I added a second paragraph tag for every ISBN. I can’t see what in the js makes this so :(

nostuff library catalogue using the Talis Platform

You may have already seen that a while a go I had a little play with the Talis Platform, and specifically a ‘store’ on the platform called ukbib which holds bibliographic records. I’ve written some pages on learning about the various parts to the platform. I had seen on the Talis Developer Network (TDN) various web services, but they all blurred in to one, the pages linked to above first work out the simple ones (e.g. linking to catalogues, holdings etc), this helped clear up the different bits that are available.

The pages then move on to playing with the ukbib ‘store’ which returns XML, you can then use XSLT to turn this in to (x)html.

So, after playing with XML, XSLT, and improving my CSS along the way, I can show the very first ‘work in progress’:

demostration of the library catalogue search.

[update: see here for an updated version]

All very early days, layout is quite basic and a number of things don’t work.

Things that don’t work (or sometimes don’t work):

  • The options on the right are based on the first ISBN found. Some recordshave several ISBNs andthe first one may be a ‘odd’ one, therefore searching Amazon, Wikipedia, libraryThing based on the unusal ISBN will probably produce either no result or the wrong item.
  • “See Books by” Author search on the bottom right hand side doesn’t work. The formating of the author’s name is probably not helping, and because this is being done in XSLT I can’t call [the php function] urlencode to turn the author names in to nice strings for the URL.
  • Some of the Subject searches don’t work or return odd results. This will hopefully be simply to fix.
  • holdings from libraries are not there yet.

Things you can do:

  • in the google-style search box you can prefix any field name to the front of a search term, e.g. Title:”programming perl”
  • title:programming title:perl author:wall

  • subject:”DDC: 005.72″

  • You can basically use any field name, I didn’t write this, it is part of the way the platform works, see here for more.

  • link to the same item (if we have the right isbn, see above) on a number of other web sites, including wikipedia, Amazon, LibraryThing etc (let’s face it, this isn’t rocket science).

This is very much a work in progress, will hopefully have another update soon.

Now I need to find out why the above search uses “author:wall” when the underlying xml uses ‘creator’ not ‘author’. hmmm.

Talis Platform

A few days a go I was bored. I had read loads about the ‘Talis Platform’ a open standards ‘you can talk to it with an API’ type thing that holds data, and shares it with you (or more to the point, shares it with your application).

Could a non-programmer like me make use of this? Hello No! but I did wonder if a non-programmer like me could cut ‘n’ paste their examples and play for myself.

Read my experience of it (though it is a little like watching the slow boy in the corner trying to read Roger Red Hat)

As an aside, I wrote this article using WordPress, but as ‘pages’ not blog entries – WordPress has basic Content Management features like creating standard pages. (Richard: that’s why it didn’t show up on RSS!).