In my previous post regardingusing libraries, I mentioned using Josh Staiger'sWake County Library LookupGreasemonkey script, which annotates Amazon.com pages with links to thelibrary, if the library has the book in it's collection.
What I neglected to mention is that I have been having problems with the scriptfor the past few weeks. One problem was that a number ofAmazon pages no longer contained the library links at all; I think this is dueto Amazon's new URL scheme. The ISBN was being pulled from the URL, and it's notalways there anymore, or in a different place. The search for the ISBN has beenexpanded so that now more books will be candidates for library lookup.
The other problem was that the page layout of the Amazon pages changed, suchthat the links Josh was adding were no longer appearing. Dark XPath and DOMhackery. ~shiver~ I fixed that by not placingthe library information in-line with the page the way Josh was doing, but placing it at the top of the page. A bit icky, but it's pretty much guaranteedthat the links will show up now; the script is not currently dependent on theshape of the HTML on the page.
I talked to Josh about the issues earlier this week, and he mentioned hehasn't been keeping a close eye on the script, because he doesn't actuallylive in Wake County anymore. Although he has been making some updates,as recent as this January. What a trooper!
So it only makes sense at this point to fork and maintain a new version ofthe code, since Josh really doesn't have a reason to do this anymore. My version of the script is here. It's highly likely that I won't be updating it, till Amazon or Wake County make enough changes to their pages to break the script again. Which is pretty much guaranteed.The perils of screen scraping.But I'm certainly open for any thoughts on the functionality.
Thanks for putting the time into this Josh!