note
astroboy
A scanner I bought on an auction site arrived today, and I've been playing with scanning my book and CD barcodes and getting the details off Amazon.
The following code seems to work on about 50% of the CDs I've tried:
<code>
use Net::Amazon;
my $ua = Net::Amazon->new( token => '<your amazon id>' );
while ( my $upc = <> ) {
my $response = $ua->search( upc => $upc, mode => 'music' );
if ( $response->is_success() ) {
print $response->as_string(), "\n";
}
else {
print "Error: ", $response->message(), "\n";
}
}
</code>
461544
461544