HIP 4.1 Amazon Linky

Inspired by Superpatron Edward Vielmetti, I have modified the Seattle Public Library’s Amazon SPL Linky to work with the Cass District Libray’s HIP. See what it does to your Amazon page:

a million little pieces

You can find it and install it here (note you must have Firefox 1.5 and Greasemonkey installed for the script to work.) Once I had the Library URL patorn from the Jon Udell’s Library Lookup Bookmarklet, it was fairly easy to modify the script. Here is what I used for the variables:

var libraryUrlPattern = 'http://ip4.cass.lib.mi.us/uPortal/Initialize?
var libraryName = 'the Cass District';
var libraryAvailability = /Checked In/;
var libraryOnOrder = /On Order/;
var libraryInProcess = /Just Received/;
var libraryDueBack = /(\d\d?\/\d\d?\/\d{4})/;
var notFound = /We were unable to find any titles that matched your search/

David Pattern helped me figure out how to adjust the libraryDueBack variable so it can deal with the fact that HIP 4.X dates do not always have the same number of digits ie:
var libraryDueBack = /(\d{2}\/\d{2}\/\d{4})/;
var libraryDueBack = /(\d\d?\/\d\d?\/\d{4})/;

Also, we do not have any status of On Order, so I didn’t change anything in that variable.

Of course, one of the downsides of this, as well as the Library Lookup bookmarklet, and anything else that relys on ISBN is that there is no way for the system to know if the library has a title that has a different ISBN, for example, we may have a large print, or paperback copy rather than whatever the patron may be looking at on Amazon.

If you build it will anyone care?

Also, just because this tool, or the Firefox extension, or the library lookup bookmarklet exist, does not mean that they will be widely adopted. While the number of people using Firefox has increased, the vast majority of patrons here (at least from my non-scientific observations) are still using IE. For them the prospect of installing Firefox, Greasemonkey, and a Userscript may be somewhat daunting. I suspect a few staff members and MAYBE a patron or two will use this….so for them, it was worth creating, however, I am still trying to think of a good way to promote this to our patrons.

About ashkev

The Fiddling Librarian 3.0 is Kevin Smith’s personal weblog. Kevin is a recent graduate with an MLS from IUPUI. Kevin is the Assistant Director of the Cass District Library which is in Cass County Michigan.
This entry was posted in Computing, Library, SirsiDynix, Web 2.0. Bookmark the permalink.

14 Responses to HIP 4.1 Amazon Linky

  1. Dave Pattern says:

    Hi Kevin

    What you need is the OCLC xISBN Project! (http://www.oclc.org/research/projects/xisbn/default.htm)

    With a bit of server side Perl scripting, I’ve come up with a version of the SPL Linky script that can handle other editions. Basically, if the ISBN doesn’t exist on HIP then it finds the ISBNs of other editions (using xISBN) and then tries searches for those too. If something is found, then the Greasemonkey script display a “other editions available” message.


  2. Dave Pattern says:

    ooops – I meant to include a link to a post with a bit more info:



  3. ashkev says:

    Could you tell me a little bit more about how you did this. I have never done any Perl scripting. I am fairly adept at modifying existing scripts though. I looked at your greasemonky script and couldn’t see exactly where it was calling the Perl script.

    Thanks for all your help,


  4. Dave, Kevin – thanks again for the xISBN pointer. I’m going to try to whup something together for the Ann Arbor District Library – the thought being that you could radically simplify the Greasemonkey script by handing all the work over to the server side.

    You’d run a script on a web server that did the moral equivalent of what the Greasemonkey script did, and returned precisely the string that you needed to add to the page. The server-side code would presumably have faster network access than your client would, so that querying the catalog 5x or 10x for variant ISBNs would not be hard.

    If that works, then it could easily be adapted for the Cass library by proxy (or for any other library anywhere…)

  5. Dave Pattern says:

    The script basically sits in the middle, between the Greasemonkey script and HIP and it does two jobs:

    1) Checks to see if an ISBN appears on the catalog. If it does, then it feeds the HIP page back to the GM script. If it doesn’t, then it consults xISBN to try and find other matches. If that fails, then it returns a “no matches found” message.

    You can see all 3 with the following URLs


    2) If the user clicks on the GM link, then it handles sending the browser to the appropriate page. In the case of the other editions being available, it constructs a URL that will make HIP show them all. Again, you can see all 3 in action:


    So, the only thing that the Perl script really does (that a normal SPL Linky script doesn’t) is to do the donkey work of finding other editions via xISBN.

    The only catch with doing it this way is that you need to set several things up:

    1) A web server where you can run the Perl script
    2) A method of quickly matching ISBNs to bib# — either by querying Horizon directly, or (in my case) having a separate text file of ISBNs and bib# that I update every night
    3) A working database connection between the Perl script and the Horizon database

    I need to learn a bit more about GM to see if it’s possible to move all the functions of the Perl script into the GM script — that would be the ideal scenario!


  6. Dave Pattern says:

    …actually, another approach would be if someone with a bit of Java skill could implement the functions of the Perl script so that they can be embedded in the HIP JBoss.


  7. Dave Pattern says:

    Edward – great minds think alike :-)

    I’ve been working on a web service that returns a simpler output for the GM script to parse – e.g.


    ..again, it uses the xISBN service to locate other matches that appear in the OPAC.

    I still need to add in the “status” for available items, but it’s nearly there.

  8. Dave – run, don’t walk to John Blyberg’s blog at http://www.blyberg.net and see what he’s doing to make a cleaner data display for output from the library catalog. (basically tagging records in xml in some ultra simple format so that they are easy to reuse). It would be great in so many ways if the Huddersfield and Ann Arbor catalogs returned data in the same format, ergo one set of javascripts instead of two.

  9. JD says:

    Wow. Last night Brandy was looking at books from Tulsa’ public library page. I decided to make her an interface that would merge Amazon with the library book info. Then this morning I checkout your blog and see it’s been done already (at least in Seattle.) Cool!

  10. ashkev says:

    JD, it should be fairly easy to adapt this to the Tulsa City-County Library. I would be happy to see if I can adapt it, if you think someone would use it.

  11. ashkev says:

    Here is the link for the Tulsa City-County Library script.

  12. Pingback: Lorcan Dempsey's weblog

  13. Pingback: Latest quilling news – ‘Kids Discover Arts’ celebrates creativity, youth

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>