October 19, 2006

Generic Library Traveller

Just dusted off some of the Library Traveller code (the Greasemonkey script that adds a floating panel over a page when there's something that looks like an ISBN in the URL, and provides links to your local library, a citation generator, Google books etc. for that book) and tried to make it a little more generic.

The script is still tied to a particular library catalogue, but I've tried to make it easier to customise by "borrowing" some code from Jon Udell's Library Lookup bookmarklet generator.

All the user has to do to customise the script is provide three pieces of information:

- the web domain for their library catalogue,;
- the library's name (actually, this could be dropped too);
- the type of library catalogue system that is running.

For example, here is the configuration information for the Open University Library Catalogue:

// ONE Your library name here
var libraryName='The Open University Library';
// TWO Your library catalogue web domain here
var libCatRoot = 'http://voyager.open.ac.uk';
// THREE Your library catalogue type
var libCatType='voyager';/

and here is the configuration information for the Keene Public Library:

// ONE Your library name here
var libraryName='Keene Public Library';
// TWO Your library catalogue web domain here
var libCatRoot = 'http://ksclib.keene.edu';
// THREE Your library catalogue type
var libCatType='innovative';

The script will only tell you if the book is held (i.e. on the records of) the library - at the moment all other library reporting (availability, when the book is due back if it's out on loan etc.) has been removed.

This is because: a) I want the script to be as generic as possible; and b) I want the user to have as little to do as possible when configuring the script.

The 'book is held' information uses the heuristic that, if the catalogue page that is returned from an ISBN lookup contains the first 20 characters of the title of that book, it's held by the library.

genericLookup.jpg

You can get hold of the script here: Generic Library Traveller script.

Comments, issues, successes, failures getting the script to work etc. much appreciated...

Posted by ajh59 at October 19, 2006 04:53 PM
Comments

I install this script and even just leaving the library info at default, it doesn't work. I only get "cite this book" in the traveller box. Wah!

Posted by: User at October 31, 2006 09:13 PM

Where di you try the script? Are you sure the book was held by the Keene Library, which is the default?
Try this:
Harry Potter and the Order of the Phoenix: http://www.amazon.com/Harry-Potter-Order-Phoenix-Book/dp/0439358078/

Posted by: Tony Hirst at October 31, 2006 11:12 PM