NAME amazon-pager

amazon-pager-0.4 - Download and merge all results of an Amazon API query.

This script was created in response to Danny Ayers's work in representing Amazon wish lists in RDF with FOAF: http://dannyayers.com/archives/002159.html and http://dannyayers.com/archives/002165.html

To avoid linking to a separate file for each part of the wish list, and to keep the lists in RDF/XML pre-transformed, I needed a way to merge the pages returned for my wish list.

I also tweaked his XSLT a bit, and switched to the heavy version of the XML returned from Amazon, so that I could include descriptions and reviews, using his review vocabulary: http://ideagraph.net/xmlns/rev/

The wish list is now auto-generated each morning, with the following command:

amazon-pager ``http://xml.amazon.com/onca/xml3?t=webservices-20&dev-t=D151B5UYK93CM2&WishlistSearch=2DM97H1FN9L9C&type=heavy&f=xml'' > wishlist.xml && xsltproc --stringparam name ``Morten Frederiksen'' --stringparam mbox_sha1sum 65b983bb397fb71849da910996741752ace8369b --stringparam seealso http://purl.org/net/morten/foaf.rdf wishlist-rdf.xsl wishlist.xml > wishlist.rdf


SYNOPSIS

amazon-pager URI


DESCRIPTION

The amazon-pager script takes a complete Amazon REST API URI, without the page parameter, and succesively downloads each result set until no more results are available.


OPTIONS AND ARGUMENTS

URI
A complete, except for the page parameter, URI to an Amazon REST API Query.

Example: http://xml.amazon.com/onca/xml3?t=webservices-20&dev-t=D151B5UYK93CM2&WishlistSearch=2DM97H1FN9L9C&type=heavy&f=xml


BUGS

None known, except that the XML ``parsing'' is done by regexps...


DOWNLOAD

amazon-pager.pl: http://www.wasab.dk/morten/2004/01/amazon-pager/amazon-pager.pl

wishlist-rdf.xsl: http://www.wasab.dk/morten/2004/01/wishlist-rdf.xsl

wishlist.rdf: http://www.wasab.dk/morten/2004/01/wishlist.rdf

FOAF Explorer view: http://xml.mfd-consult.dk/foaf/explorer/?foaf=http://www.wasab.dk/morten/2004/01/wishlist.rdf


AUTHOR

MFD Consult, Morten Frederiksen <morten@mfd-consult.dk>

URL: http://www.wasab.dk/morten/2004/01/amazon-pager/