mundell.org The personal weblog of Carrick Mundell

Posted
27 April 2005 @ 4pm

Tagged: Browsers, Greasemonkey, Web

LibraryLookup Greasemonkey script

Update: I have a new, better script available. Check it out. If you’re still interested in the older script below, please continue reading.

A few weeks ago I set out to paste together my first Greasemonkey script along the lines of Jon Udell’s uber-cool LibraryLookup. What I have so far falls short of Udell’s, but it is a step forward. I borrowed code not from Udell but from another LibraryLookup script: Amazon Linky.

My script does one thing. On any Amazon.com book listing page, the script inserts a link below the book title which, when clicked, will search for the book in the Seattle Public Library catalog. It’s like inserting a LibraryLookup bookmarlet into the page itself. Here’s a picture:

Amazon Library Lookup

To make use of this script you’ll need Firefox and the Greasemonkey extension. Once those are installed, right-click (or ctrl+click) amazonspllinky.user.js and choose “install user script.” Then browse for a book.

AddThis Social Bookmark Button

24 Comments

Posted by
Tri Nguyen
29 April 2005 @ 10pm

Thank you very much. Listen, I live in Seattle too and use my SPL card nearly as often as my credit card. Great greasemonkey script!


Posted by
alpha
5 May 2005 @ 4pm

As the author of Amazon Linky, I am really glad to see your script. I just want to point out another script that you may be interested:
http://overstimulate.com/articles/2005/04/24/greasemonkey-book-burro-find-cheap-books

I think their implementation (use AJIX) is much nicer than mine. I’ll try to adapt theirs next week.


Posted by
T. Dunn
17 May 2005 @ 11pm

Are you planning to do one for the Bellingham Public Library(http://www.bellinghampubliclibrary.org/)? I’m moving there very soon and would love to be able to search the Bellingham, WA library system from Amazon.


Posted by
Carrick
18 May 2005 @ 9pm

I wasn’t planning to, but I just whipped one up for you. Here it is: amazonbellhamlinky.user.js. Enjoy.


Posted by
T. Dunn
19 May 2005 @ 12am

Wow! Thanks so much! This will make searching for books much easier!


Posted by
Lori
20 May 2005 @ 4pm

I love this script! I’m a reference librarian at San Leandro Public Library in California. We use Amazon all the time and it would be great to have a lookup link to our own library to see if we have the book in stock.

Is there an easy way for me to change the lookup from SPL to San Leandro Public Library?


Posted by
Carrick
20 May 2005 @ 6pm

I’d love to help you on this but it looks like the catalog at your library doesn’t support ISBN searches, which seems strange considering it’s using Dynix just like SPL. The script is pretty simple, and if you can somehow find out how to perform ISBN searches on your catalog, you would simply have to change the URL and search term format I’ve used in my script to suit your system. My guess would be something like:

http://www.library.ci.san-leandro.ca.us/ipac20/ipac.jsp?&index=ISBNEX&term=

I tried that on your catalog and it threw an error.


Posted by
Lori
21 May 2005 @ 9am

Thanks so much for trying! I’ll talk to some folks here and see if one or all of us can figure this out.

I’ll let you know when/if we resolve the problem.


Posted by
Ian Irving
28 May 2005 @ 3pm

We done Carrick!

I customized your gm script for the Canada’s Toronto Public Library (details here), plus a small modification by separating the Library Search Url and Library name variables to make it a little easier to customized for other Library Systems.

Also the UK Amazon site is the only one where it dones not work, but only because they do not use the class name to insert the link at.


[…] book title to search for the ISBN in the Seattle Public Library Catalog. More Palo Alto Library Adds links that display whether the book is av […]


Posted by
Heather
2 June 2005 @ 2pm

Wow, this is cool! I’m definitely getting my IT guy on it!


[…] the plugin. Have fun, happy searching, and use your library! For a related hack, try my LibraryLookup Greasemonkey script for one-click searching of books using Ama […]


Posted by
Sathish
13 June 2005 @ 1pm

Thanks Mundell, I modified the Amazon Bellingham script and created Amazon New York Public Library lookup linky.
http://www.sathish.net/tech/index.html


Posted by
Sathish
13 June 2005 @ 1pm

I forgot to mention that both Bellighan and NYPL use Dynix Library system.


Posted by
Keith Ketover
21 June 2005 @ 11pm

How about the King County Library System? Would it be possible to make a version for KCLS? Does it work on CDs and DVDs as well as books?


Posted by
Carrick
22 June 2005 @ 8am

Good idea, Keith. I use KCLS from time to time. Here is it: amazonkclslinky.user.js.

And, yeah, it only works with books because it’s keyed on the ISBN. Recordings and videos don’t use ISBNs.


Posted by
Frank
30 June 2005 @ 11am

This seems to be very promising but although I’ve managed to install greasemonkey and, I believe the Seattle + Philadelphia Search scripts, I don’t see — at Amazon, the link that is supposed to show up. I’m puzzled where I went wrong. It appeared to have installed properly. I DID get a SPL link in the Search box with Google but that’s not quite the function here of the script.

As a book author what I really want — and what was briefly available once years ago, is a means to search one book title and then results that tell me IN AS MANY LIBRARY CATALOGS AS POSSIBLE, where is this book available? I want to know how many libraries in USA is currently carrying my book? It’s sort of a metasearch engine for all libraries? Does anyone know a service like this? I’ve tried asking librarians.


Posted by
Tara
3 July 2005 @ 7am

I’m wondering how i would go about editing this for the monroe county library system. The search url is http://www.rochester.lib.ny.us:2080/cgi-bin/cw_cgi?5000, but I don’t know what to do with that to make it work. I would love to have this script.

Can you point me in the right direction?

Thanks!


Posted by
Bruce
4 July 2005 @ 1am

This script looks like a precursor as to how the web can suit the user. Great! How can the script be modified to search your local libraries, say in the UK?


Posted by
Bruce
5 July 2005 @ 6am

Hi,
I’ve been experimenting with this url pattern http://www.librarycatalogue.info/cgi-bin/vps2_viewpoint.sh?session_no=69521&enqtype=ISBN&enqpara1=DEFAULT
but it throws an error which just says ‘error in reading index’
I think my library uses the DS system. Any ideas would be greatly appreciated.
thanks. Or is thier a forum I could put this problem to?
thanks again


Posted by
Carrick
5 July 2005 @ 4pm

Tara, I don’t see any way of doing it for the Monroe County Libraries. Their cataloging system doesn’t expose the search syntax in the URL, which is required for this script to work. For example, my script for SPL uses the following syntax:

'http://catalog.spl.org/ipac20/ipac.jsp?&index=ISBNEX&term=' + isbn

Perhaps someone at your library system could help you with the syntax you need. Good luck.


Posted by
Carrick
5 July 2005 @ 5pm

Bruce, my poking around at your Brighton and Hove City Library Service seems to indicate they don’t allow catalog searches without a valid session number, and, unfortunately, sessions have a very short duration (on the order of minutes.) Perhaps there is a “magic” session number reserved by the technical minds behind that particular cataloging system for “anytime” queries, or perhaps there is a hidden search syntax that doesn’t require a valid session number. It will probably require a chat with the gurus behind the scenes to find out. Cheers.


Posted by
Bruce
5 July 2005 @ 11pm

Thanks Carrick. I’ll contact them and see what they say. Thanks again.


[…] About six weeks ago, I cobbled together a quickie Greasemonkey script for including a LibraryLookup link in Amazon’s book pages to the Seattle Public Library. It’s proved very handy. Some non-techie family members are using it, and it’s generated more comments and feedback than any previous entry on this here blog. […]