1#!/usr/bin/perl 2############################################################ 3# artist artist_name 4# Mike Schilli <mschilli1@aol.com>, 2003 5############################################################ 6 7use strict; 8use warnings; 9 10use Net::Amazon; 11use Net::Amazon::Request::Artist; 12 13die "usage: $0 artist\n(use Zwan as an example)\n" unless defined $ARGV[0]; 14 15my $ua = Net::Amazon->new( 16 associate_tag => $ENV{AMAZON_ASSOCIATE_TAG}, 17 token => $ENV{AMAZON_TOKEN}, 18 secret_key => $ENV{AMAZON_SECRET_KEY}, 19); 20 21my $req = Net::Amazon::Request::Artist->new( 22 artist => $ARGV[0], 23); 24 25 # Response is of type Net::Amazon::Artist::Response 26my $resp = $ua->request($req); 27 28if($resp->is_success()) { 29 print $resp->as_string, "\n"; 30} else { 31 print $resp->message, "\n"; 32} 33