Written by Technology

Amazon Web Services A Go Go

Well not content with finally twiddling with MTAmazon enough to get it working, I’ve now been playing with the top 10 thing on the right hand side of the page.
Basically you can play around with Amazon.com’s scratchpad in an attempt to build an RSS XML feed, but the scratchpad doesn’t fully work. For one thing, the locale setting makes no difference, and for another, it doesn’t mention RSS feeds.
It’s easy enought to discover that these need to be of the form:
http://xml.amazon.com/onca/xml3?t=webservices-20&dev-t=amznRss&BrowseNodeSearch=130&mode=dvd&bcm=DVD
&type=lite&page=1&ct=text/xml&sort=+salesrank
&f=http://xml.amazon.com/xsl/xml-rss091.xsl
But that’s only good for the US. First I inserted &locale=uk into the string, and then I replaced the initial URL with xml-eu.amazon.com which started serving me with the correct information. The resultant URLs were completely wrong since Amazon doesn’t have a UK version of xml-rss091.xsl. So I took a copy of that file, and just replaced all the amazon.com’s with amazon.co.uk and saved it locally.
Et voila, after replacing developer tokens and associate ID, you get what I have on the right.
Here’s the sample code:
http://xml-eu.amazon.com/onca/xml3?t=webservices-20
&dev-t=amzn-Rss&BrowseNodeSearch=62&mode=books&bcm=
&type=lite&page=1&ct=text/xml&sort=+salesrank
&locale=uk&f=http://www.adambowie.com/weblog/xml-rss091.xsl
UPDATE: One thing to note is that I have bastardised that xml-rss091.xsl file a bit so that the description no longer exists. I’ve replaced this with Amazon’s asin code since I wanted to use that in conjunction with MTAmazon to pull in pictures of the books. Now I probably should have rewritten the file entirely into an RSS 2.0 compliant version, thus letting me have both pieces of information. But that seemed just too much like hard work. I’m sure someone else will fully script that version.