Pobieranie informacji o książce/płycie o podanym numerze UPC (z amazon.com
):
#!/usr/bin/perl # use Net::Amazon; use Net::Amazon::Request::UPC; my $code = '633367991522' ; # UPC (z kodem EAN są problemy) # Token/secret_key do pobrania po zarejestrowaniu się na str. # https://aws-portal.amazon.com/gp/aws/developer/account/index.html/177-3749078-2923747 my $ua = Net::Amazon->new( token => '####################', secret_key => '########################################', ); my $req = Net::Amazon::Request::UPC->new( upc => $code, mode => 'music', ); # Response is of type Net::Amazon::Response::UPC my $resp = $ua->request($req); if($resp->is_success()) { print $resp->as_string(), " (UPC)\n"; } else { print "Error: ", $resp->message(), "\n"; } # end