Some cool local library tech

Well now, why would Amazon be telling me that rather than purchase that book I could go to one of the Loudoun library branches and check it out instead? If you’re at all nerd-tastic you might recognize the name of the program “greasemonkey,” a Firefox extension that allows little locally-installed scripts to massage the way things are presented in your web browser. Loudoun has posted a link right on their main page directing you to instructions on how to install greasemonkey and the script itself on your copy of Firefox. Once you do it’ll automagically check to see if the item you’re browsing is available to be checked out (or reserved, in the case of the book I was looking at above) rather than purchased.
If you’re a total cheapskate frugal like myself it’s a great thing to have installed. It both checks the viability of checking the item out of the library rather than purchasing it and serves as a reminder that I should be doing that rather than buying it anyway…
Aside: as a programmer m’self I have to say I think it would have been nice if they gave some sort of credit to Carrick Mundell, the original author of the script. He doesn’t require it – didn’t even put any comments or copyright in his script, which he originally posted for free here – but it seems like the right thing to do.
This Loudoun resident and frequent LPL user thanks you.
That’s about the most logical use of Greasemonkey I’ve seen yet. Anyone want to do one for Arlington?
Arlington’s got a lot of potential, based on my poking at it for an hour (don’t tell my boss).
The quick & dirty solution is to use the RSS option. This url searches for Freakonomics:
http://158.59.15.116/rss.asp?q=006073132X
It hands back some XML that has this link in it:
http://158.59.15.116/?itemid=default::CARL0000642314
Pulling that URL gets a page sufficiently similar to the Loudoun page (http://catalog.lcpl.lib.va.us/ipac20/ipac.jsp?&profile=adm&ri=&index=PISBNEX&term=006073132X) that it would take little tweaking. So there would need to be an added step in the existing script to pull that first RSS url and get the second one.
Someone who wanted to take a little more time could massage things even more. Using this url:
http://158.59.15.116/detailrender.asp?hreciid=206611228&lastquery=006073132X
I can get an XML feed with all the data on a proper search by hand. Unfortunately the hRec field is required and is presumably a database handle from the current run of the application – it likely will change when the system reboots if I am guessing correctly about the behind-the-scenes infrastructure. So likely you’d have to do a sequence of things beforehand, connecting to http://www.acornweb.org, getting the (why???) IP it redirects you to (perhaps it changes or round-robins?) and getting that hreciid field, then building the query
But, once you did that it would be -real- easy to show availability down to your local specific branch.