Web Services

I just finished writing a CFML 4.5-compatible script for using Amazon’s Web Services. It’s not complete, but it’s fully functional.
What it does is this: It sends a CFHTTP request over to amazon with the generated XML query string & returns it as an array of structures, each structure representing one match. It lists all attribute-less unique fields from the amazon-heavy.dtd. Additionally, it concatenates the author/artist, browsenode & similarproduct lists into comma-delineated strings within the structure. I don’t pull out reviews, at this point. Additionally, the link generated in the URL attribute of details is popped in as linkURL.

Why do you care about these details? you probably don’t. But that’s what I did.

You can play with it here. It will soon become an integral part of Bookbuffet.

If you’d like to link to this, it accepts the following queryparameters:
term: what to seach for
mode: what to search in
searchtype: how to search
resultstype: light or heavy
page: page number of results to look at (amazon returns results in batches of 10).

Update (sunday, 10:45 am): now returns any customer reviews in an array of structures called reviews, which is a key/value pair in the structures returned in AmazonArray.

Also, did some minor formatting of the test output page (although I didn’t do anything about the wierd spacing as objects float left on the page). So all procrastination complete, it’s time to insert this code into the project it was designed for. Hopefully, sometime soon, I’ll be able to show that off too.