LibraryLookup for the San Francisco Public Library
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 Amazon.com with the catalog systems of public libraries. If the book you’re looking at on Amazon is available at the library, the script inserts a little notification in the header of the Web page, like so:
Jon originally wrote the script for the libraries in his hometown of Keene, New Hampshire, but his original idea has since been modified to work with the libraries of communities across the globe. I never found a good version for San Francisco, though, so I hacked together my own version to work with the SFPL’s unique quirks.
Installation
To get my version of the script working, you first need to install the latest version of the Greasemonkey add-on for Firefox. This allows the script to run 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.
Note that the script is keyed off ISBN numbers. There is a unique ISBN for each edition of a book; so if you’re looking at the paperback version of a book on Amazon, try checking the hardcover version too. Libraries are more likely to stock hardcover editions, if available. (Earlier versions of the script tried to do this cross-checking for you, but I found they yielded too many false positives.)
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. It also doesn’t understand books that are available for library use only. But in general, it should work most of the time. Take it for a spin and let me know if it’s useful to you.
Change Log
(12 Oct 2008) Version 1.5 now checks for books that are on order at the library but have not yet arrived. Also, clicking on the library link now sends you over to the more user-friendly search results page, even though the actual queries are still carried out using the advanced search. I removed the XISBN functionality; it’s a nice idea, but in practice it was returning far too many false positives and inconsistent results. Finally (and perhaps most importantly), I went ahead and did a thorough clean-up of the source code, getting rid of the unorthodox and inconsistent indentation and eliminating unused code.
(1 May 2008) Version 1.3 should now work with Firefox versions 2 and 3.
(2 April 2008) Version 1.2 uses a more complex query, which should return results for all of the branch libraries, instead of just the first few.


