LibraryLookup for San Francisco public libraries

My former colleague at InfoWorld, Jon Udell, came up with a really clever JavaScript hack for avid readers who use Firefox,* called LibraryLookup. It cross-references product pages at with the catalog systems of public libraries. Whenever a book you’re browsing at Amazon is available at your local library, the script automatically lets you know, by inserting a notification into the Amazon page that links to the library’s online card catalog. It really comes in handy, especially if you’re an impulse book-buyer.

Jon originally wrote the script for the libraries in his hometown of Keene, New Hampshire, but there are only so many different library catalog systems in use. The script is adaptable to any of them, and lots of folks have modified it to work with the systems in their own communities. I never found a good version for San Francisco, though, so I spent some time working with Jon’s latest code to get it working. It needed just a couple of tweaks.

You can click on the image below to see what an Amazon page might look like with the script installed:

Screenshot of Library Lookup in Action

To get the script working, you need to install the latest version of the Greasemonkey add-on for Firefox. This is the engine that runs the script automatically whenever you load an Amazon page. With Greasemonkey installed, you should be able to click the following link to automatically install the LibraryLookup script for San Francisco public libraries. It should begin working immediately.

The script isn’t perfect. It doesn’t sort the due dates on checked-out copies of books, for example, so you’re not always given the earliest date that a copy of a book will be back on a shelf. The SFPL’s system also doesn’t display every branch that has a copy of the book, only the ones it deems “most relevant” (which seem to be more alphabetical than anything else). And it can occasionally be a little sluggish. But, in general, this system gives you a good idea as to whether a given book is in the library system and is readily available for check-out. Take it for a spin and let me know if it’s useful to you.

UPDATE (2 April 2008): Version 1.2 uses a more complex query, which should return results for all of the branch libaries (instead of just the first few).

UPDATE (1 May 2008): Version 1.3 should now work with Firefox versions 2 and 3.

*The latest is that Jon claims to have gotten his script working with Internet Explorer, instead of just Firefox, but I can’t vouch for that. Read his blog post on the subject and see if you can get it working, if IE is your browser of choice.