Thursday, December 29, 2005

Seattle Public Library LibraryLookup bookmarklet

I fixed up a LibraryLookup bookmarklet for Seattle Public Library so it works correctly.

Just drag this link into your browser's shortcut/link/bookmark toolbar:

Lookup at SPL

I'll let Jon Udell, the LibraryLookup originator, explain what a LibraryLookup bookmarklet is for and how you use it.

"If your local public (or college) library uses one of the online catalog systems listed here, you may be able to create a bookmarklet that will help you look up books in your library.

After you've 'installed' your bookmarklet by dragging it to your browser's link toolbar, you can use it to look up books at your local library. Let's say you're on a book-related site (Amazon, BN, isbn.nu, All Consuming, possibly others), and a book's info page is your current page. (Specifically: its URL contains an ISBN. Choose a hardcover edition for best results -- see tips below.) You can click your bookmarklet to check if the book is available in your local library. The bookmarklet will invoke your library's lookup service, feed it the ISBN, and pop up a new window with the result."


There is a bookmarklet for Seattle Public Library on Jon's site, but I think a backend change at SPL broke it. If you try to use that one, you will get the following error from the SPL website: "Sorry, unable to execute search Shortcut was not found. Aspect = ISBN".

I just hacked the URL to change ISBN to ISBNEX, which makes it all work hunky-dory. To be precise, I changed this:

javascript:var%20re=/([\/-]|is[bs]n=)(\d{7,9}[\dX])/i;
if(re.test(location.href)==true){var%20isbn=RegExp.$2;
void(win=window.open('http://ipac.spl.org/ipac20/ipac.jsp?index=ISBN&term='+isbn,
'LibraryLookup','scrollbars=1,resizable=1,width=575,height=500'))};

to this:

javascript:var%20re=/([\/-]|is[bs]n=)(\d{7,9}[\dX])/i;
if(re.test(location.href)==true){var%20isbn=RegExp.$2;
void(win=window.open('http://ipac.spl.org/ipac20/ipac.jsp?index=ISBNEX&term='+isbn,
'LibraryLookup','scrollbars=1,resizable=1,width=575,height=500'))};

Thanks to Jon Udell for this in the first place, and to Finn for prodding me to finally figure out why it was broken. And three cheers for public libraries!

Browser compatibility:

Firefox 1.5 on Mac & Win: works.

IE7 on Vista Dec CTP (5270): works, but you may need to adjust security settings to add it to your link toolbar to drag and drop it to your links toolbar - try adding this website to the trusted sites list, or maybe add the bookmark by right-clicking.

Safari: doesn't work. Does not spawn a new window to execute & display the SPL search. Leave a hint in comments if you figure out why not, maybe related to the window open command?

No comments:

Post a Comment