1#!/usr/bin/perl
2############################################################
3# author author_name
4# Christopher Boumenot <boumenot@gmail.com>, 2006
5############################################################
6
7use strict;
8use warnings;
9
10use Net::Amazon;
11use Net::Amazon::Request::Author;
12
13#use Log::Log4perl qw(:easy);
14#Log::Log4perl->easy_init($DEBUG);
15
16die "usage: $0 author\n(use Schilli as an example)\n" unless defined $ARGV[0];
17
18my $ua = Net::Amazon->new(
19    associate_tag => $ENV{AMAZON_ASSOCIATE_TAG},
20    token         => $ENV{AMAZON_TOKEN},
21    secret_key    => $ENV{AMAZON_SECRET_KEY},
22);
23
24my $req = Net::Amazon::Request::Author->new(
25    author  => $ARGV[0],
26);
27
28# Response is of type Net::Amazon::Author::Response
29my $resp = $ua->request($req);
30
31if($resp->is_success()) {
32    print $resp->as_string, "\n";
33} else {
34    print $resp->message, "\n";
35}
36