/usr/share/doc/libnet-amazon-perl/examples/power is in libnet-amazon-perl 0.62-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #!/usr/bin/perl
######################################################
# Power Search
# Martin Streicher <martin.streicher@apress.com>, 2003
# Mike Schilli <na@perlmeister.com>, 2003
######################################################
use warnings;
use strict;
use Net::Amazon;
use Net::Amazon::Property;
use Net::Amazon::Request::Power;
use Getopt::Std;
#use Log::Log4perl qw(:easy);
#Log::Log4perl->easy_init($DEBUG);
my %opts = ();
my $usage = "usage: $0 [-s start] [-f finish] phrase [mode]\n".
"(use 'subject: perl and author: schwartz' books ".
"as an example)\n";
getopts("s:f:", \%opts) || do {print $usage; exit 1};
die $usage
if ((!defined $ARGV[0]) ||
((exists $opts{s} && exists $opts{f}) && ($opts{f} < $opts{s})));
my $pagecnt = $opts{s} || 1;
my $limit = $opts{f} || $opts{s} || 1;
my $mode = $ARGV[1] || "books";
my $ua = Net::Amazon->new(
associate_tag => $ENV{AMAZON_ASSOCIATE_TAG},
token => $ENV{AMAZON_TOKEN},
secret_key => $ENV{AMAZON_SECRET_KEY},
max_pages => 1,
);
while ($pagecnt <= $limit) {
my $req = Net::Amazon::Request::Power->new(
power => $ARGV[0],
mode => $mode,
page => $pagecnt++,
sort => 'inverse-pricerank',
node => 377602011,
);
# Response: Net::Amazon::Power::Response
my $resp = $ua->request($req);
die "Error" unless $resp->is_success();
last unless $resp->status();
for ($resp->properties) {
print $_->Asin(), " ",
$_->title(), " [",
$_->isbn(), "] ",
$_->OurPrice(), "\n";
}
}
|