Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Anyone Have Perl Code for New Amazon API?

by ww (Archbishop)
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 with sample code of various sorts.

  • Comment on Re: Anyone Have Perl Code for New Amazon API?

Replies are listed 'Best First'.
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?

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2020-12-05 18:40 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (65 votes). Check out past polls.