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 Userscripts.org, 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:

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: http://userscripts.org/scripts/show/60170
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?
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.
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:
http://hip.virl.bc.ca/
If you can make sense of it it would be fantastic.
Chris
Hi Chris, I've updated the Greasemonkey script to be case-insensitive, which will help. See: http://userscripts.org/scripts/show/60170 – 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.
Script is great. Thanks for such quick work. I'll poke around for the status
codes.
Chris
It worked on Amazon.ca but not on Amazon.com. Was this intentional?
Hi Brenton – no, it should work on amazon.anything. A quick test had it working for me on the amazon.com site as well – it can sometimes be a little slow…
yahoo! this is awesome, thanks for doing this and for sharing.
this is great! very useful as i usually do this manually. thanks for making it possible!
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 webcat.vsb.bc.ca 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?
There's one for Greater Victoria Public Library now too at http://userscripts.org/scripts/show/61185.
Your script was mentioned at a recent BC Library Association workshop BTW so there might be more libraries doing this soon. Hopefully 🙂
There's one for Greater Victoria Public Library now too at http://userscripts.org/scripts/show/61185.
Your script was mentioned at a recent BC Library Association workshop BTW so there might be more libraries doing this soon. Hopefully 🙂
The VPL/Amazon script is awesome– thank you!!
VPL just got a new catalogue so I don’t think the script works anymore. Any chance you’re going to rework it?
It still works but I think it’s because they still have the old ipac catalogue in the background. It might not work once they get rid of it for good.
It still works but I think it’s because they still have the old ipac catalogue in the background. It might not work once they get rid of it for good.
Thank you for your script, haven’t mastered how it works but i love the idea 🙂
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?