Problem solving

First John Udell came up with the library lookup bookmarklet. Way cool! I’ll be showing this at my poster session at IL2004.

Then Jessamyn and Andrea attempt to port the bookmarklet to work with WorldCat via Google. Unfortunately, they got close but couldn’t get it to work.

So, bored this evening, waiting for a phone call I decided to tackle the problem. (Did I mention I know very little about Javascript.) Undaunted I guessed that the problem has little to do with the complicated stuff and more to do with the URL the script was generating.

So, I sat in front of Andrea’s notes, started where she thought the problem was and about an hour or so later I’d found the solution. The problems were three-fold:

  1. The pluses and ampersands needed to be hex encoded as part of the generated URL. Else, they were assumed to be bits of javascript.
  2. The generated URL, as written, put stuff in the wrong order. I discovered this by trying the bits in different orders directly into Google. I then rearranged it into the only order Google would accept.
  3. At the end I dumped the “I’m feeling lucky” feature just to troubleshoot. Suddenly, it worked. So, I did some quick searching for other lucky-based bookmarklets and figured out there was sum unneeded code stuck on the end.

So, all three problems solved. Here’s the revised, working bookmarklet for looking up books in Open WorldCat.

Posted in 1Tagged

Leave a Reply

Your email address will not be published. Required fields are marked *