I'm having one of these days: http://xkcd.com/456
I've fallen behind on updating my recently read books section because it's no longer easy to do... Many years ago I wrote a tool that would take a book title and search specific sites for images and links and build the HTML needed for a book post. A while back it stopped working because the sites I was scrapping data from have changed. Since then I've not been able to find a consistent site to pull images from.
Today I decided that I would spend the time to just update my book list manually. I needed to add 9 books... I made it through three. Searching for images of the right size is real pain, so I was keeping my eye open for a site that hosted the same sized images for every book. I realized that the Seattle Public Library shows book covers, so I checked out their site. Their cover image URLs look like this: http://www.syndetics.com/index.aspx?isbn=0596101996/LC.JPG&client=sepup&type=xw12&oclc=&upc= This looked decent. If I knew the book's ISBN, then I could get the cover image. Except the image was bigger than I wanted... hmmm... does LC.jpg = Large Cover? What if I change it to MC.jpg, will I get a Medium Cover? Yep, sweet!
At this point my simple plan of manually updating the site had been completely derailed. I figured I could write a program that finds the ISBN from a book title, then pulls down the right sized image. I still needed to find the Amazon product site for the ISBN, but I hoped that would be easy... It is, apparently amzn.com/isbn works.
I decided to write the app in Javascript and use Node.js... Node.js wasn't installed on my Dreamhost server, so I had to download, build, and install it. My first call in my program was going to do a Google search of the library page. My original tool used the Google Search APIs, so I figured I'd just use the same key and call. Nope, the Search APIs I originally used have been deprecated in favor of the Google Custom Search API. So I had to figure that out (not too hard) and set up a custom search thingy. Then I hit up the Node.js docs to see how to make a simple GET. I copied an example which worked great. Then I tweaked it to hit the secure googleapis.com url... and I got an error. Searching for the error, I saw that the version of Node.js that I installed isn't yet stable. Great. So I downloaded the stable version and built/installed that instead.
The stable version had a different http API than the one I was using, so I copied an example and tweaked that one... It worked! Ok, now I was in business. I had all the necessary pieces and it was just a matter of coding it up.
Well... I was using a completely uncustomized version of emacs for editing, and I figured if I was really going to get serious about Javascript programming on my webserver, then I better download js2-mode. I downloaded it but noticed that it works on Emacs 22 or higher... Emacs on the webserver is 21.4.1. So I downloaded emacs 23.2 and started building it. At this point I asked myself "Woah! What am I doing?!? I was going to simply update my blog and now here I am building Emacs! How the heck did I get here?!?"
I instantly thought of that xkcd comic and then promptly abandoned my work to write this blog post... With that done, I guess it's time to start popping the stack... <POP>