Changeset 33219
- Timestamp:
- 05/10/09 20:05:17 (4 years ago)
- Location:
- lang/perl/URI-Amazon-APA/trunk
- Files:
-
- 2 removed
- 4 modified
-
MANIFEST (modified) (1 diff)
-
README (modified) (1 diff)
-
lib/URI/Amazon/APA.pm (modified) (4 diffs)
-
t/01-basic.t (modified) (1 diff)
-
t/boilerplate.t (deleted)
-
t/pod-coverage.t (deleted)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/URI-Amazon-APA/trunk/MANIFEST
r33218 r33219 6 6 t/00-load.t 7 7 t/01-basic.t 8 t/pod-coverage.t9 8 t/pod.t -
lang/perl/URI-Amazon-APA/trunk/README
r33214 r33219 1 URI-Amazon-APA 1 NAME 2 URI::Amazon::APA - URI to access Amazon Product Advertising API 2 3 3 The README is used to introduce the module and provide instructions on 4 how to install the module, any machine dependencies it may have (for 5 example C compilers and installed libraries) and any other information 6 that should be provided before the module is installed. 4 VERSION 5 $Id: README,v 0.1 2009/05/10 11:04:33 dankogai Exp dankogai $ 7 6 8 A README file is required for CPAN modules since CPAN extracts the README 9 file from a module distribution so that people browsing the archive 10 can use it to get an idea of the module's uses. It is usually a good idea 11 to provide version information here so that people can decide whether 12 fixes for the module are worth downloading. 7 SYNOPSIS 8 # self-explanatory 9 use strict; 10 use warnings; 11 use URI::Amazon::APA; 12 use LWP::UserAgent; 13 use XML::Simple; 14 use YAML::Syck; 13 15 16 use URI::Amazon::APA; # instead of URI 17 my $u = URI::Amazon::APA->new('http://webservices.amazon.com/onca/xml'); 18 $u->query_form( 19 Service => 'AWSECommerceService', 20 Operation => 'ItemSearch', 21 Title => shift || 'Perl', 22 SearchIndex => 'Books', 23 ); 24 $u->sign( 25 key => $public_key, 26 secret => $private_key, 27 ); 14 28 15 INSTALLATION 29 my $ua = LWP::UserAgent->new; 30 my $r = $ua->get($u); 31 if ( $r->is_success ) { 32 print YAML::Syck::Dump( XMLin( $r->content ) ); 33 } 34 else { 35 print $r->status_line, $r->as_string; 36 } 16 37 17 To install this module, run the following commands: 38 EXPORT 39 None. 18 40 19 perl Makefile.PL 20 make 21 make test 22 make install 41 METHODS 42 This adds the following methods to URI object 23 43 24 SUPPORT AND DOCUMENTATION 44 sign 45 Sings the URI accordingly to the Amazon Product Advertising API. 25 46 26 After installing, you can find documentation for this module with the 27 perldoc command. 47 $u->sign( 48 key => $public_key, 49 secret => $private_key, 50 ); 28 51 29 perldoc URI::Amazon::APA 52 signature 53 Checks the signature within the URI; 30 54 31 You can also look for information at: 55 print "The signature is " : $u->signature; 32 56 33 RT, CPAN's request tracker 34 http://rt.cpan.org/NoAuth/Bugs.html?Dist=URI-Amazon-APA57 AUTHOR 58 Dan Kogai, "<dankogai at dan.co.jp>" 35 59 36 AnnoCPAN, Annotated CPAN documentation 37 http://annocpan.org/dist/URI-Amazon-APA 60 BUGS 61 Please report any bugs or feature requests to "bug-uri-amazon-apa at 62 rt.cpan.org", or through the web interface at 63 <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=URI-Amazon-APA>. I will 64 be notified, and then you'll automatically be notified of progress on 65 your bug as I make changes. 38 66 39 CPAN Ratings 40 http://cpanratings.perl.org/d/URI-Amazon-APA67 SUPPORT 68 You can find documentation for this module with the perldoc command. 41 69 42 Search CPAN 43 http://search.cpan.org/dist/URI-Amazon-APA/ 70 perldoc URI::Amazon::APA 44 71 72 You can also look for information at: 45 73 46 COPYRIGHT AND LICENCE 74 * RT: CPAN's request tracker 47 75 48 Copyright (C) 2009 Dan Kogai 76 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=URI-Amazon-APA> 49 77 50 This program is free software; you can redistribute it and/or modify it 51 under the same terms as Perl itself. 78 * AnnoCPAN: Annotated CPAN documentation 52 79 80 <http://annocpan.org/dist/URI-Amazon-APA> 81 82 * CPAN Ratings 83 84 <http://cpanratings.perl.org/d/URI-Amazon-APA> 85 86 * Search CPAN 87 88 <http://search.cpan.org/dist/URI-Amazon-APA/> 89 90 ACKNOWLEDGEMENTS 91 <http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.h 92 tml?rest-signature.html> 93 94 COPYRIGHT & LICENSE 95 Copyright 2009 Dan Kogai, all rights reserved. 96 97 This program is free software; you can redistribute it and/or modify it 98 under the same terms as Perl itself. 99 -
lang/perl/URI-Amazon-APA/trunk/lib/URI/Amazon/APA.pm
r33218 r33219 2 2 use warnings; 3 3 use strict; 4 our $VERSION = sprintf "%d.%02d", q$Revision: 0. 2$ =~ /(\d+)/g;4 our $VERSION = sprintf "%d.%02d", q$Revision: 0.1 $ =~ /(\d+)/g; 5 5 use Carp; 6 6 use POSIX qw(strftime); … … 42 42 } 43 43 44 if ( $0 eq __FILE__ ) {45 }46 47 44 1; # End of URI::Amazon::APA 48 45 … … 51 48 URI::Amazon::APA - URI to access Amazon Product Advertising API 52 49 53 54 50 =head1 VERSION 55 51 56 $Id $52 $Id: APA.pm,v 0.1 2009/05/10 11:01:30 dankogai Exp dankogai $ 57 53 58 54 =head1 SYNOPSIS 59 55 60 Quick summary of what the module does. 56 # self-explanatory 57 use strict; 58 use warnings; 59 use URI::Amazon::APA; 60 use LWP::UserAgent; 61 use XML::Simple; 62 use YAML::Syck; 61 63 62 Perhaps a little code snippet. 64 use URI::Amazon::APA; # instead of URI 65 my $u = URI::Amazon::APA->new('http://webservices.amazon.com/onca/xml'); 66 $u->query_form( 67 Service => 'AWSECommerceService', 68 Operation => 'ItemSearch', 69 Title => shift || 'Perl', 70 SearchIndex => 'Books', 71 ); 72 $u->sign( 73 key => $public_key, 74 secret => $private_key, 75 ); 63 76 64 use URI::Amazon::APA; 65 66 my $foo = URI::Amazon::APA->new(); 67 ... 77 my $ua = LWP::UserAgent->new; 78 my $r = $ua->get($u); 79 if ( $r->is_success ) { 80 print YAML::Syck::Dump( XMLin( $r->content ) ); 81 } 82 else { 83 print $r->status_line, $r->as_string; 84 } 68 85 69 86 =head1 EXPORT 70 87 71 A list of functions that can be exported. You can delete this section 72 if you don't export anything, such as for a purely object-oriented module. 88 None. 73 89 74 =head1 FUNCTIONS90 =head1 METHODS 75 91 76 =head2 function1 92 This adds the following methods to L<URI> object 93 94 =head2 sign 95 96 Sings the URI accordingly to the Amazon Product Advertising API. 97 98 $u->sign( 99 key => $public_key, 100 secret => $private_key, 101 ); 102 103 =head2 signature 104 105 Checks the signature within the URI; 106 107 print "The signature is " : $u->signature; 77 108 78 109 =head1 AUTHOR … … 115 146 =back 116 147 117 118 148 =head1 ACKNOWLEDGEMENTS 119 149 150 L<http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html> 120 151 121 152 =head1 COPYRIGHT & LICENSE -
lang/perl/URI-Amazon-APA/trunk/t/01-basic.t
r33218 r33219 17 17 secret => '1234567890', 18 18 ); 19 warn $u;19 #warn $u; 20 20 #is ($u->signature, 'Nace/U3Az4OhN7tISqgs1vdLBHBEijWcBeCqL5xN9xg='); 21 21 is ($u->signature, 'Nace+U3Az4OhN7tISqgs1vdLBHBEijWcBeCqL5xN9xg=');
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)