Greasemonkey VPL Catalogue Listings Script for Amazon

So David Eaves posted “5 Municipal apps I’d love to see“. One of them was an extension of an existing Greasemonkey script to search local library catalogue listings when browsing Amazon. So I downloaded Bryan Larsen’s Ottawa library script, modified it to look up in the Vancouver library, and have now posted in on, for all of your pleasure.

Even if the initial lookup fails, you can still do a direct title & ISBN lookup from links that the Greasemonkey script pushes into the page, directly below the title of the book:

The VPL Greasemonkey script at work on Amazon
The VPL Greasemonkey script at work on Amazon

So, install the script, and test it out on Amazon! Let me know if you have any issues

UPDATE: I’ve updated the script a couple of times since this was initially posted, with the following revisions:

1.0: basic modification of the script
1.1: updated to include a new ISBN look-up URL variable
1.2: updated the ISBN lookup to use the correct OCLC web service
1.3: Fixed getIsbn() regex to look for /,? or end-of-string to extract the ISBN.
1.4: edited the Code-matching to use a central array of codes, and loop over those to provide a simplified messaging around status, and in particular, multiple statuses.

This means that it should be *alot* easier for anyone to further modify this in the future for any other libraries they may want to hook into, as well as providing better answers for books with multiple statuses and copies.

Ideally, I’d like to have this crawl the resulting code to pull out both the branch & due-date information, but this’ll do for now I think.

UPDATE 2009-10-20: There’s now also a script for use on the Vancouver Island Regional Library too:

20 Replies to “Greasemonkey VPL Catalogue Listings Script for Amazon”

  1. I live on Vancouver Island and am wondering where one might look to find out how to adapt the script to the Vancouver Island Regional Library. Any ideas?

  2. Well, I don't know the URL of that library system, but if they used the same software as the VPL, the edit will be as simple as changing the URLs on 2 lines of code at the top of the script – I'm happy to do it for you, if you can tell me the URL.

  3. Vancouver Island Regional Library serves all the small libraries on the
    island and Gulf Islands. I poked around trying to change some of the URL's
    in your script on the hope that it would have the same back end as Vancouver
    but no luck. I am not sure where to start looking for their ISBN data base.
    The URL is:

    If you can make sense of it it would be fantastic.


  4. Hi Chris, I've updated the Greasemonkey script to be case-insensitive, which will help. See: – this is linked to the VIRL library system.

    Of note, there's a bit of code near the top that lists the “Status Codes” returned by a library – these are generally different for each library system, and so the ones currently in there, from the VPL, are likely different from the ones in VIRL. For instance, a checked out book is “CHECKED OUT” at the VPL, but “Checked out” at VIRL. If you can find a list of codes, that would be swell – either you or I could then easily update this script to have the correct codes.

  5. Your terrific script here got some airplay to a room of system librarians yesterday. I also run a local library catalogue for the Vancouver School Board. As a lib of course I want to go all crazy to credit you for this 'we love it' tool (wait for that). As we use the same app for our catalogue I'll just do the tweak as you suggest.

    You say Liam is in school? Glad to know he'll find Dad's app at the school library, hey?

  6. VPL just got a new catalogue so I don’t think the script works anymore. Any chance you’re going to rework it?

  7. many libraries are interested in knowing what books citizens are interested in, could there be a way for someone to search on amazon, realize that their library doesn’t have the book but send a message to the library requesting the book be purchased? the requests would be reviewed for suitability and if purchased and put in circulation a note could be sent back to the original searcher?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: