Adding "Google Book Search" information to catalog records

by Administrator Tuesday, April 15, 2008 9:15 AM
A couple of weeks ago Google released a Book Viewability API for Google Book Search. I'm always looking for ways to enhance the usefulness of library catalogs so of course I had to give it a try! Google offers 3 ways to set this up. I looked at Sample 1: Using a Callback to Determine Viewability and figured that would be pretty easy to implement using raw HTML in the Inmagic DB/TextWorks form designer and wrapping the ISBN with the supplied code. First I pasted the script code from the Google site into the Head tag under Form Properties. I wrapped the ISBN field with beginning and ending text as instructed. Then I added a box to initiate the search by adding the ISBN again and wrapping it again with different beginning and ending text to send the request to the Google Books search server. I was delighted that in 10 minutes I had created a form that checked Google Book Search as the page loaded and if a match was found, it displayed the link to Preview in Google Book Search. Unfortunately after announcing my success to my colleagues I was disappointed to find that this does not work in IE6 and is unreliable in IE7 and Firefox. As Peter puts it: "IE6 is having trouble parsing things synchronously. The API returns a JSON (Javascript Object Notation) object which calls the function ProcessGBSBookInfo() when it is written into the page. The browser is supposed to wait until the external script resource is loaded before parsing said contents and moving on past the closing script tag. IE6 is not doing this consistently. Notice sometimes you can refresh the page and the preview link will appear. Such is life with older browsers and synchronous javascript-driven page updates. Although the sample you chose to implement seems the most straightforward, you can see now why there are reasons for going with more complicated options: AJAX options would be asynchronous and would avoid this type of issue, for instance, but at the cost of more up-front scripting." You can check out my test page. Click on the link for Google Book Search which is a canned search of records in this test database with ISBN's - hopefully you will see some links to Preview in Google from the full displays. These can include the cover image, table of contents and chapter excerpts and would be very useful for users evaluating a title. Anyone wanting more background might want to listen to the Library 2.0 Gang podcast. I guess we'll have to wait till we have time to test the AJAX methodology before we suggest clients implement this. In the meantime if anyone would like us to push this higher on our development schedule, please let us know!

blog comments powered by Disqus

Month List