Projects: JavaScript

Javascripts

Austin Public Library/Amazon Greasemonkey Script

Greasemonkey is an awesome extension for Firefox that modifies the content of web pages you browse with custom info. This script automatically looks in the Austin Public Library to see if the book you are looking at is available at the library. You can then place a hold and so on.
Austin LibraryLookup. Updated: 7/6/08 1:30 PM

Austin Public Library/Amazon Bookmarklet

This is a “bookmarklet”, a cross between a bookmark and an applet. How it works is to put it into the bookmarks bar of your browser (works in Safari and Firefox) and when you are looking at a book on Amazon.com, click the bookmarklet and it will look that book up in the Austin Public Library online catalog. It’s quite handy and the old one didn’t work with the new version of the catalog.

To install it, simply drag the link below to your browser’s toolbar:
APL

Here’s the code for the bookmarklet:

javascript:var%20re=/(%5B%5C/-%5D%7Cis%5Bbs%5Dn=)
(%5Cd%7B7,9%7D%5B%5CdX%5D)/i;
if(re.test(location.href)==true)%7Bvar%20isbn=RegExp.$2;
void(win=window.open('http://www.ci.austin.tx.us'+
'/uhtbin/cgisirsi/x/0/0/5/?searchdata1='+
isbn,'LibraryLookup',
'scrollbars=1,resizable=1,location=1,width=575,height=500'))%7D

To test it, click this link: Bringing Down the House: The Inside Story of Six M.I.T. Students Who Took Vegas for Millions (Paperback), then click the “APL” link in the toolbar. Unfortunately, the only indication you get that a book is not available is, well, nothing—that is to say that nothing at all happens. I’ve found that if the book I'm looking at is not available, looking to see if there’s another edition (i.e., hardback) and trying that.