|
From: <car...@20...> - 2012-02-18 21:07:21
|
Hello, Inspired by this article http://perlmeister.com/lme/prod-0812.pdf I arrange myself a barcode scanner to make an inventory of my books. (to be honest I am talking about the german version of the document at http://perlmeister.com/snapshots/200810/index.html ) I am now using this example code: use Net::Amazon; my $ua = Net::Amazon->new( associate_tag => 'foobar', token => 'xxx', secret_key => 'xxxxxx', max_pages => '1', ); my $response = $ua->search(asin => "$ARGV[0]"); if($response->is_success()) { print $response->as_string(), "\n"; } else { print "Error: ", $response->message(), "\n"; } I am not sure if the associate_tag is of any importance, but it seems is just has to exist, no matter whats the value. The token an scecret_key are what I also use for Amazon S3 service. But this script works only for _some_ ISBN-10 or ISBN-13 barcodes for example this works: # perl x.pl 0596004613 [1] Rob Flickenger, "Linux Server Hacks: 100 Industrial-Strength Tips and Tools", 2003, $13.72, 0596004613 But this ISBN-13 doesn't work, it's this book http://www.amazon.de/Linux-Server-Hacks-Bill-Hagen/dp/0596100825/ref=sr_1_1?s=books-intl-de&ie=UTF8&qid=1329597639&sr=1-1 # perl x.pl 9780596100827 Error: 9780596100827 is not a valid value for ItemId. Please change this value and retry your request. Even not as ISBN-10 # perl x.pl 0596100827 Error: 0596100827 is not a valid value for ItemId. Please change this value and retry your request. Any Idea why this only works with some books ? Is this because I am located in Germany ? I am clueless Thanks Carlos |