URI-Amazon-APA

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

      use URI::Amazon::APA; # instead of URI
      my $u = URI::Amazon::APA->new('http://webservices.amazon.com/onca/xml');
      $u->query_form(
        Service     => 'AWSECommerceService',
        Operation   => 'ItemSearch',
        Title       => shift || 'Perl',
        SearchIndex => 'Books',
      );
      $u->sign(
        key    => $public_key,
        secret => $private_key,
      );

      my $ua = LWP::UserAgent->new;
      my $r  = $ua->get($u);
      if ( $r->is_success ) {
        print YAML::Syck::Dump( XMLin( $r->content ) );
      }
      else {
        print $r->status_line, $r->as_string;
      }

README  view on Meta::CPAN

    None.

METHODS
    This adds the following methods to URI object

  sign
    Sings the URI accordingly to the Amazon Product Advertising API.

      $u->sign(
        key    => $public_key,
        secret => $private_key,
      );

  signature
    Checks the signature within the URI;

      print "The signature is " : $u->signature;

AUTHOR
    Dan Kogai, "<dankogai at dan.co.jp>"

lib/URI/Amazon/APA.pm  view on Meta::CPAN

  my $u = URI::Amazon::APA->new('http://webservices.amazon.com/onca/xml');
  # or                           https://webservices.amazon.com/onca/xml
  $u->query_form(
    Service     => 'AWSECommerceService',
    Operation   => 'ItemSearch',
    Title       => shift || 'Perl',
    SearchIndex => 'Books',
  );
  $u->sign(
    key    => $public_key,
    secret => $private_key,
  );

  my $ua = LWP::UserAgent->new;
  my $r  = $ua->get($u);
  if ( $r->is_success ) {
    print YAML::Syck::Dump( XMLin( $r->content ) );
  }
  else {
    print $r->status_line, $r->as_string;
  }

lib/URI/Amazon/APA.pm  view on Meta::CPAN

=head1 METHODS

This adds the following methods to L<URI> object

=head2 sign

Sings the URI accordingly to the Amazon Product Advertising API.

  $u->sign(
    key    => $public_key,
    secret => $private_key,
  );

=head2 signature

Checks the signature within the URI;

  print "The signature is " : $u->signature;

=head1 AUTHOR



( run in 0.427 second using v1.01-cache-2.11-cpan-a5abf4f5562 )