#!/usr/bin/perl ########################################### # asin_fetch # Mike Schilli, 2003 (m@perlmeister.com) # Fetch book info by ASIN # asin_fetch 0201360683 ########################################### use warnings; use strict; use Net::Amazon; use Net::Amazon::Request::ASIN; use Data::Dumper; use Log::Log4perl qw(:easy); Log::Log4perl->easy_init($DEBUG); my $ua = Net::Amazon->new( associate_tag => $ENV{AMAZON_ASSOCIATE_TAG}, token => $ENV{AMAZON_TOKEN}, secret_key => $ENV{AMAZON_SECRET_KEY}, ); die "usage: $0 asin\n(use 0201360683 as " . "an example)\n" unless defined $ARGV[0]; my $req = Net::Amazon::Request::ASIN->new( asin => $ARGV[0], type => 'heavy', ); # Response is Net::Amazon::ASIN::Response my $resp = $ua->request($req); if($resp->is_success()) { print Dumper($resp), "\n"; }