AmazonWishListTextBackup

Note: You are viewing an old revision of this page. View the current version.

Update: this page previously contained a python script based almost entirely on something written by Jon Udell. However as of October 2009 Amazon requires you to use your secret key for REST queries so that code no longer works.

Luckily, the perl Net::Amazon module has just been updated to work with the new Amazon requirements. With a very small amount of tweaking of an example form that module I was able to once again create a script which dumps my wishlist as a text file. You still need to supply your wishlist ID from your wishlist URL on the Amazon website. You also need to provide both your AWS access key and your secret key, both of which are available for free at the AWS website. You will also need to install the Net::Amazon module from CPAN.

Once again this is a terrible, terrible script. Note that Amazon returns results in fixed 'pages' of 10, so you have to supply a number of total pages ahead of time. Net::Amazon does one query per second to comply with Amazon rules so this can take a while. I have about 650 wishlist items so I just set the number or pages to 100 for a maximum of 1000 results (and a fixed script runtime of 100 seconds).

#!/usr/bin/perl -w

use Net::Amazon;
use Net::Amazon::Request::Wishlist;

my $ua = Net::Amazon->new(
    token      => 'your aws key',
    secret_key => 'your aws secret',

    max_pages => 100
);

my $req = Net::Amazon::Request::Wishlist->new(
    id  => 'your wishlist id'
);

# Response is of type Net::Amazon::ASIN::Response
my $resp = $ua->request($req);

if($resp->is_success()) {
    print $resp->as_string, "\n";
} else {
    print $resp->message(), "\n";
}


Our Founder
ToolboxClick to hide/show