php - Getting product details using Amazon API -


I've got the following code to output a list of items from Amazon, but I'm not sure that specific products How to use (with summary, review, etc.) Any help would be appreciated.

  & lt ;? Php function makeAWSUrl ($ parameter, $ associate_tag, $ access_key, $ secret_key, $ aws_version = '2009-06-01') {$ host = 'ecs.amazonaws.com'; $ Path = '/ onca / xml'; $ Query = array ('service' = & gt; 'AWSECommerceService', 'AWSAccessKeyId' = & gt; $ access_key, 'AssociateTag' = & gt; $ associate_tag, 'Timestamp' => GMDET ('Ymd \ TH: I: s \ z '),' version '= & gt; $ aws_version,); // Merge any option that was given in the if_array ($ parameter) {$ query = array_merge ($ query, $ parameters); } // case-insensitive, sort the natural order on the array key ksort ($ query); // signable string $ temp = array (); Forex Currency ($ query = $ as query => $ v) {$ temp [] = str_replace ('% 7E', '~', CrudeLancode ($ k)). '=' Str_replace ('% 7E', '~', CrudeLancode ($ v)); } $ Signable = implode ('& amp;', $ temp); $ StringToSign = "get \ n $ host \ n $ path \ n $ signaling"; // Hash AWS secret key and generate a signature for the request. $ Hex_str = hash_hmac ('sha256', $ stringToSign, $ secret_key); $ Raw = ''; ($ I = 0; $ i & lt; strlen ($ hex_str); $ i + = 2) {$ raw. = Chr (hexadec (substr ($ hex_str, $ i, 2))); } $ Query ['sign'] = base64_encode ($ raw); Ksort ($ query); $ Temp = array (); Forex Currency ($ query = $ $ = $ $ v) {$ temp [] = CrudeLine code ($ k) '=' rawurlencode (V $); } $ Final = implode ('& amp;', $ temp); Return 'http: //' $ host $ path '?' . Last $; } $ Url = makeAWSUrl (array ('keyword' = & gt; 'ipod', 'operation' => 'item search', 'searchindex' =>, 'electronics'), 'response group' = & gt ; 'Medium', 'some', 'aaaaaa', 'aaaaaaaaaaaaaaaa'); $ Response = simplexml_load_file ($ url); Forex Currency ($ response-> item-> item $ items) {$ headline [] = $ item- & gt; Item Properties-> Title; } Foreign currency ($ $ $ title as the $ headline) {resonant "& lt; h2" gt; $ CurrentTitle "& Lt; / h2 & gt;"; }? & Gt;    

$ response-> Item- & gt; The item list contains all the items / articles that match your query. This is a list of objects ; Each of these items gets properties like ItemAtributes , which can then have properties.

To see which properties are avalable for example ItemAttributes-> ListPrice-> Quantity is the price of the item.

For example, output value and title for each result in the code

  $ response = simplexml_load_file ($ url); Foreign objects ($ reaction-> item-> item $ items) {resonant "& lt; h2>" $ Item- & gt; Item Properties- & gt; Title. "& Lt; / h2 & gt;"; Echo "value:" $ Item- & gt; Property Properties-> List Price- & gt; Zodiac; }  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -