Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Anyone Have Perl Code for New Amazon API?

by ww (Bishop)
on Oct 27, 2011 at 21:51 UTC ( #934252=note: print w/ replies, xml ) Need Help??


in reply to Anyone Have Perl Code for New Amazon API? [SOLVED]

Esoteric question; iggerant answer:

Possibly outdated by the change you're decrying, but does Net::Amazon offer any help? Seems to have some possibilities

("Net::Amazon::Request::UPC  request class for UPC search")
per the parenthesized material, quoted from CPAN). And see also http://net-amazon.sourceforge.net/ with sample code of various sorts.


Comment on Re: Anyone Have Perl Code for New Amazon API?
Re^2: Anyone Have Perl Code for New Amazon API?
by DanielSpaniel (Scribe) on Oct 27, 2011 at 21:56 UTC

    :-) .. no, there are no iggerant answers in response to this question ... Anything that might help is appreciated!

    Interesting, haven't checked it yet, but I'll wander over to that sourceforge link and see if there's some sample code worth hacking ...

      Solved. This was actually much easier than what I thought it was going to be ...

      For anyone else that seeks Perl/Amazon API wisdom, for the new API, then a couple of things:

      You can't just tack on the associates ID to the end of the request URL, because: firstly the params need to be in alphabetical order (yes, really ... so odd), but most importantly, it needs to be part of the request URL which gets "signed." That is, if you just tack it in the URL some place, without it being the portion of the URL which gets signed, then it won't work ... you'll get some signature error code back from Amazon.

      So, if you have the example code from the previous API, then find the code in there which looks a bit like the code below, and simply insert the AssociateTag line in there. I think that's the only required new param, although there are several other changes to the API. The version line might need to be changed as well, although right now it works with the old version date.

      my $request = { Service => 'AWSECommerceService', AssociateTag =>'xxxxxx', Operation => 'ItemSearch', BrowseNode=> $$node, Keywords =>"$$keywords", ItemPage =>"$$itempage", SearchIndex => $$searchindex, Version => '2009-03-31', ResponseGroup => $$response, };

      Thanks to all who responded! Appreciated.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://934252]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-07-12 17:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls