LibraryLookup for the San Francisco Public Library
Update: I’ve written a new version of the script that works with Google’s Chrome browser. To install it, simply click this link. You do not need GreaseMonkey to get LibraryLookup working on Chrome. Note that LibraryLookup uses cross-site scripting, so it must run as a Background Page in Chrome. That means it’s running all of the time, even when you’re not browsing Amazon. It shouldn’t consume any significant resources, but it is there nonetheless. Note, also, that the Chrome version is a substantial rewrite from the Firefox version, so I’m particularly interested to hear any bug reports.
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.
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.
(24 July 2011) Added a version for the Google Chrome browser. This version is a substantially different code base and will need to be developed in parallel with the Firefox version as any further changes are made.
(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.