Mercurial > hg > ywww
annotate xml/getAmazonInfo.php @ 41:0578c6e438d3
merge
author | Henry S. Thompson <ht@inf.ed.ac.uk> |
---|---|
date | Sun, 30 Jul 2017 05:36:48 -0400 |
parents | 77ff181476b8 ae1459564f66 |
children | 3f400072bf14 |
rev | line source |
---|---|
4 | 1 <?php |
2 | |
5 | 3 $lastReqTime=0; |
4 | 4 function getAmazonDet($isbn,$go,$localeIn) |
5 { | |
6 global $output; | |
7 $Adefault=array( | |
8 'language' =>'en', //what language to render the page in | |
9 'locale' =>$localeIn, //which server's products? available: ca,de,fr,jp,uk,us | |
10 //'mode' =>'books', //what product category? | |
11 'page' =>1, //first page to show (we are counting from 1 not 0) | |
12 //'search' =>'Machiavelli', //what to search for? | |
13 'operation' =>'ItemLookup', //what to do? //ItemSearch | |
14 // 'searchindex' =>'Books', //what product category for search? | |
15 'searchparameter' =>'ItemId', //what kind of search? | |
16 'searchparameterdata'=>$isbn, //what to search for? | |
17 //here some debugging flags you can put at the end of the URL to call this script with, like: '?show_array=true' | |
18 'show_array' =>false, //debug: show complete incoming array? You can use this to see what other information Amazon is sending | |
19 'show_url' =>false, //debug: show XML request url to be send to Amazon? | |
20 'show_xml' =>false, //debug: show incoming XML code from Amazon? | |
21 ); | |
22 //change the debug options to true if you want to activate them or call the script with '?show_array=true' to see what actual information you're getting from Amazon and how little my standard script is actually showing of it | |
23 | |
24 $Aassociates_id=array( | |
25 'uk' => 'bookwhack-21', | |
26 'us' => 'your02b-20', | |
27 'ca' => 'book009-20', | |
28 'de' => 'book04c-21', | |
29 'fr' => 'book07f-21', | |
30 ); | |
31 | |
32 $Aserver=array( | |
33 'ca' => array( | |
34 'ext' => 'ca' , //Canadian normal server | |
35 'nor' => 'http://www.amazon.ca' , //Canadian normal server | |
36 'xml' => 'http://xml.amazon.com' , //Canadian xml server | |
37 ), | |
38 'de' => array( | |
39 'ext' => 'de' , //German normal server | |
40 'nor' => 'http://www.amazon.de' , //German normal server | |
41 'xml' => 'http://xml-eu.amazon.com', //German xml server | |
42 ), | |
43 'fr' => array( | |
44 'ext' => 'fr' , //French normal server | |
45 'nor' => 'http://www.amazon.fr' , //French normal server | |
46 'xml' => 'http://xml-eu.amazon.com', //French xml server | |
47 ), | |
48 'jp' => array( | |
49 'ext' => 'jp' , //Japanese normal server, not co.jp! | |
50 'nor' => 'http://www.amazon.co.jp' , //Japanese normal server | |
51 'xml' => 'http://xml.amazon.com' , //Japanese xml server | |
52 ), | |
53 'uk' => array( | |
54 'ext' => 'co.uk' , //UK normal server | |
55 'nor' => 'http://www.amazon.co.uk' , //UK normal server | |
56 'xml' => 'http://xml-eu.amazon.com', //UK xml server | |
57 ), | |
58 'us' => array( | |
59 'ext' => 'com' , //USA normal server | |
60 'nor' => 'http://www.amazon.com' , //USA normal server | |
61 'xml' => 'http://xml.amazon.com' , //USA xml server | |
62 ), | |
63 ); | |
64 | |
65 //if(go != 1) | |
66 //include "aws_signed_request.php"; | |
17
ae1459564f66
Replace old associate keys with new IAMs user keys
Robert Boland <robert@markup.co.uk>
parents:
11
diff
changeset
|
67 $public_key ="AKIAIHTNWC7L6LOUY4LQ"; |
ae1459564f66
Replace old associate keys with new IAMs user keys
Robert Boland <robert@markup.co.uk>
parents:
11
diff
changeset
|
68 $private_key="zWQlIzndJDtXNfxEXH7K7YR7hzv3u77lOcqfqPde"; |
4 | 69 //for all parameters see if the user has overruled it or use the default |
70 foreach ($Adefault as $i=>$d) { | |
71 $$i=isset($_GET[$i])?$_GET[$i]:$d; | |
72 } | |
73 //this is the data that is used to form the request for AWS | |
74 //this is the part that is search specific | |
75 $parameters=array( | |
76 'Operation' =>$operation , | |
77 //'Keywords' =>urlencode($search) , | |
78 //'SearchIndex' =>$searchindex , //Books for example. | |
79 "$searchparameter"=>$searchparameterdata , | |
80 'ItemPage' =>$page , //which page? | |
81 'AssociateTag' =>$Aassociates_id[$locale], | |
82 'ResponseGroup' =>'ItemAttributes,Reviews,EditorialReview,OfferSummary,Offers,Images,AlternateVersions,SalesRank,BrowseNodes' , //Small, Medium, Large or SellerListing,'BrowseNodes',// , | |
83 'ReviewSort' =>'-HelpfulVotes' | |
84 ); | |
85 | |
86 $ext=$Aserver[$locale]['ext']; | |
87 $file_data=$ext; | |
88 ksort($parameters); | |
89 foreach ($parameters as $i=>$d) { | |
90 $file_data.='&'.$i.'='.$d; | |
91 } | |
92 | |
93 $url=aws_signed_request($ext,$parameters,$public_key,$private_key); | |
94 //echo $url; | |
95 $crl = curl_init(); | |
96 $timeout = 5; | |
97 curl_setopt ($crl, CURLOPT_URL,$url); | |
98 curl_setopt ($crl, CURLOPT_ENCODING , "gzip"); | |
99 curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1); | |
100 curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout); | |
5 | 101 /* $timeDiff=((int)(microtime(true)*1000))-$lastReqTime; |
102 if ($timeDiff<1000) { | |
103 usleep((1000-$timeDiff)*1000); // microseconds | |
104 }*/ | |
4 | 105 $output = curl_exec($crl); |
5 | 106 //$lastReqTime=(int)(microtime(true)*1000); // milliseconds |
4 | 107 curl_close($crl); |
108 | |
109 /*$xml = new SimpleXMLElement("<?xml version=\"1.0\"?><ItemLookupErrorResponse xmlns=\"http://ecs.amazonaws.com/doc/2009-03-31/\"><Error><Code>AccountLimitExceeded</Code><Message>Account limit of 2056 requests per hour exceeded.</Message></Error><RequestID>290ed059-730c-4789-93b4-6d21e11053d3</RequestID></ItemLookupErrorResponse>");*/ | |
110 $review = ""; | |
5 | 111 // HST added this |
112 if (preg_match("<Error>",$output)) { | |
113 $xml = new SimpleXMLElement($output); | |
114 $resName=$xml->getName(); | |
115 $code=$xml->Error->Code; | |
40
77ff181476b8
geoip fix?, better debugging
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
11
diff
changeset
|
116 file_put_contents('/var/ywww/debug/phpDebug',"Losing (test): $resName, $code\n",FILE_APPEND); |
7
1dfe64e365a0
a bit more debugging/bomb-proofing
Robert Boland <robert@markup.co.uk>
parents:
5
diff
changeset
|
117 if ($code=='RequestThrottled') { |
1dfe64e365a0
a bit more debugging/bomb-proofing
Robert Boland <robert@markup.co.uk>
parents:
5
diff
changeset
|
118 usleep(200000); // Try to reduce throttling until we get a |
1dfe64e365a0
a bit more debugging/bomb-proofing
Robert Boland <robert@markup.co.uk>
parents:
5
diff
changeset
|
119 // principled solution in place |
1dfe64e365a0
a bit more debugging/bomb-proofing
Robert Boland <robert@markup.co.uk>
parents:
5
diff
changeset
|
120 } |
9
232deb0b066a
tidy up debugging, only show parms on non-throttled error
Henry S. Thompson <ht@markup.co.uk>
parents:
7
diff
changeset
|
121 else { |
40
77ff181476b8
geoip fix?, better debugging
Henry S. Thompson <ht@inf.ed.ac.uk>
parents:
11
diff
changeset
|
122 file_put_contents('/var/ywww/debug/phpDebug',"parms: $go\nurl: $url\n". |
9
232deb0b066a
tidy up debugging, only show parms on non-throttled error
Henry S. Thompson <ht@markup.co.uk>
parents:
7
diff
changeset
|
123 print_r($parameters,TRUE)."\n",FILE_APPEND); |
10
5aa24c984a3b
if no code show entire response
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
124 if ($code=="") { |
11
c9ebf871114b
fix wrong var in debug output
Henry S. Thompson <ht@markup.co.uk>
parents:
10
diff
changeset
|
125 file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$output\n",FILE_APPEND); |
10
5aa24c984a3b
if no code show entire response
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
126 } |
9
232deb0b066a
tidy up debugging, only show parms on non-throttled error
Henry S. Thompson <ht@markup.co.uk>
parents:
7
diff
changeset
|
127 } |
5 | 128 } |
129 else { | |
130 $xml = new SimpleXMLElement($output); | |
131 set_error_handler(function () { | |
132 global $output; | |
133 file_put_contents('/var/ywww/debug/phpDebug', | |
134 "Caught one?: ".$searchparameterdata, | |
135 FILE_APPEND); | |
136 file_put_contents('/var/ywww/debug/phpDebug', | |
137 print_r($output, TRUE)."\n", | |
138 FILE_APPEND); | |
4 | 139 } ); |
5 | 140 $review = $xml->Items->Item->CustomerReviews->IFrameURL; |
141 // The above is failing repeatedly -- | |
142 //PHP Notice: Trying to get property of non-object in | |
143 // /var/ywww/xml/getAmazonInfo.php on line [109] | |
144 // See the dumped structure at the end of this file for the | |
145 // cause | |
146 restore_error_handler(); | |
147 //echo $review; | |
148 $review1 = ""; | |
149 $review2 = ""; | |
150 $review3 = ""; | |
151 } | |
4 | 152 if ($review != "") |
153 { | |
154 $text = @file_get_contents($review . "&truncate=300"); | |
155 $removeTop1 = preg_replace('~<div class="crIFrameHeaderLeftColumn">(.*?)<div class="crIFrameHeaderHistogram">~si', '', $text); | |
156 $removeTop2 = preg_replace('~<div class="crIFrameHeaderHistogram">(.*?)<div class="crIframeReviewList">~si', '', $text); | |
157 if (preg_match('~<body[^>]*>(.*?)</body>~si', $removeTop2, $body)){ $getBody = trim($body[1]); } | |
158 $removeDiv = preg_replace('~<div[^>]*>(.*?)</div>~si', '', $getBody); | |
159 $removeCloseDivs = preg_replace('/<\/div>/','', $removeDiv); | |
160 $setBoundary = str_replace('<!-- BOUNDARY -->','BOTTOM-TOP', $removeCloseDivs); | |
161 //replace <!-- BOUNDARY --> with BOTTOM-TOP | |
162 $remove1 = '~<table cellpadding="0"(.*?)%">~s'; | |
163 $setBoundary = preg_replace($remove1,'', $setBoundary); | |
164 $remove2 = '~</td><td bg(.*?)</table>~s'; | |
165 $setBoundary = preg_replace($remove2,'', $setBoundary); | |
166 $remove3 = '~<a name=(.*?)</a>~s'; | |
167 $setBoundary = preg_replace($remove3,'', $setBoundary); | |
168 $setBoundary2 = str_replace('<br />','', $setBoundary); | |
169 //remove all extra crap; | |
170 $setBoundary3 = str_replace('</td>','BOTTOM', $setBoundary2); | |
171 //replace </td> with BOTTOM | |
172 | |
173 if (preg_match_all('~TOP(.*?)BOTTOM~s', $setBoundary3, $reviews)) | |
174 { | |
175 $reviewContents = $reviews[1]; | |
176 //print_r($reviewContents); | |
177 $review1 = trim($reviewContents[0]); | |
178 $review1 = str_replace("\n", "", $review1); | |
179 $review1 = str_replace("\r", "", $review1); | |
180 if (isset($reviewContents[1])) { | |
181 $review2 = trim($reviewContents[1]); | |
182 $review2 = str_replace("\n", "", $review2); | |
183 $review2 = str_replace("\r", "", $review2); | |
184 } | |
185 else { | |
186 $review2 = ""; | |
187 } | |
188 if (isset($reviewContents[2])) { | |
189 $review3 = trim($reviewContents[2]); | |
190 $review3 = str_replace("\n", "", $review3); | |
191 $review3 = str_replace("\r", "", $review3); | |
192 } | |
193 else { | |
194 $review3 = ""; | |
195 } | |
196 } | |
197 else | |
198 { | |
199 $review1 = ""; | |
200 $review2 = ""; | |
201 $review3 = ""; | |
202 //echo "EPIC FAIL"; | |
203 } | |
204 | |
205 unset($xml->Items->Item->CustomerReviews); | |
206 $xdoc = new DomDocument; | |
207 $xdoc->loadXML($xml->asXML()); | |
208 | |
209 $cReviews = $xdoc ->createElement('CustomerReviews'); | |
210 $cReviewHolder = $xdoc ->createElement('Review'); | |
211 $cReview = $xdoc ->createElement('Content'); | |
212 $cReviewHolder2 = $xdoc ->createElement('Review'); | |
213 $cReview2 = $xdoc ->createElement('Content'); | |
214 $cReviewHolder3 = $xdoc ->createElement('Review'); | |
215 $cReview3 = $xdoc ->createElement('Content'); | |
216 | |
217 $txtNode = $xdoc ->createTextNode ($review1); | |
218 $cReview -> appendChild($txtNode); | |
219 | |
220 $txtNode2 = $xdoc ->createTextNode ($review2); | |
221 $cReview2 -> appendChild($txtNode2); | |
222 | |
223 $txtNode3 = $xdoc ->createTextNode ($review3); | |
224 $cReview3 -> appendChild($txtNode3); | |
225 | |
226 $cReviewHolder -> appendChild($cReview); | |
227 $cReviewHolder2 -> appendChild($cReview2); | |
228 $cReviewHolder3 -> appendChild($cReview3); | |
229 | |
230 $cReviews -> appendChild($cReviewHolder); | |
231 $cReviews -> appendChild($cReviewHolder2); | |
232 $cReviews -> appendChild($cReviewHolder3); | |
233 | |
234 $xdoc->documentElement->childNodes->item(1)->childNodes->item(1)->appendChild($cReviews); | |
235 $newXML = simplexml_import_dom($xdoc); | |
236 $output = $newXML->asXml(); | |
237 } | |
238 | |
239 switch($locale){ | |
240 case "us": | |
241 $loc = 0; | |
242 break; | |
243 case "uk": | |
244 $loc = 1; | |
245 break; | |
246 case "ca": | |
247 $loc = 2; | |
248 break; | |
249 case "de": | |
250 $loc = 3; | |
251 break; | |
252 case "fr": | |
253 $loc = 4; | |
254 break; | |
255 }; | |
256 | |
257 $errorCode = $xml->Error->Code; | |
258 //echo $errorCode; | |
259 | |
260 if($errorCode != "AccountLimitExceeded") | |
261 { | |
5 | 262 if($go == 1) { |
263 file_put_contents('/var/ywww/debug/phpDebug',"win: ". | |
264 $xml->Items->Item->ItemAttributes->Title."\n", | |
265 FILE_APPEND); | |
4 | 266 return $output; |
5 | 267 } |
4 | 268 else |
269 { | |
270 $title = $xml->Items->Item->ItemAttributes->Title; | |
271 $author = $xml->Items->Item->ItemAttributes->Author; | |
272 $binding = $xml->Items->Item->ItemAttributes->Binding; | |
273 $dewey = $xml->Items->Item->ItemAttributes->DeweyDecimalNumber; | |
274 if($dewey == "") | |
275 $dewey = "null"; | |
276 $imageURL = $xml->Items->Item->MediumImage->URL; | |
277 $salesRank = $xml->Items->Item->SalesRank; | |
278 $pubDate = $xml->Items->Item->ItemAttributes->PublicationDate; | |
279 $publisher = $xml->Items->Item->ItemAttributes->Publisher; | |
280 | |
281 $genreID = ""; | |
282 $genre = ""; | |
283 $genArr = array(); | |
284 | |
285 for($i=0;$i<sizeof($xml->Items->Item->BrowseNodes->BrowseNode);$i++){ | |
286 //sexy recursive function | |
287 findGenre($xml->Items->Item->BrowseNodes->BrowseNode[$i], $genreID, $genre); | |
288 | |
289 if($genre != "") | |
290 $genArr[strval($genreID)] = strval($genre); | |
291 //$genArr[$i] = array(strval($genreID) => strval($genre)); | |
292 | |
293 //echo $genre; | |
294 //echo $genreID; | |
295 | |
296 $genre = ""; | |
297 $genreID = ""; | |
298 } | |
299 | |
300 $g1 = "null"; | |
301 $g2 = "null"; | |
302 $g3 = "null"; | |
303 $loop = 1; | |
304 | |
305 foreach ($genArr as $key => $value) { | |
306 //echo "$key => $value"; | |
307 $queryG = "CALL b_addBrowseNode($key,\"$value\")"; //add the name value pair for genre to new table | |
308 //echo $queryG; | |
309 include "../../private/db.php"; | |
310 $resG = mysqli_query($link, $queryG); | |
311 mysqli_close($link); | |
312 | |
313 switch ($loop) { | |
314 case 1: | |
315 $g1 = $key; | |
316 break; | |
317 case 2: | |
318 $g2 = $key; | |
319 break; | |
320 case 3: | |
321 $g3 = $key; | |
322 break; | |
323 } | |
324 | |
325 $loop++; | |
326 } | |
327 | |
328 if($salesRank == "") | |
329 $salesRank = "null"; | |
330 | |
331 $title = strtr($title, '"', "'"); | |
332 include "../../private/db.php"; | |
333 $review1 = mysqli_real_escape_string($link,$review1); | |
334 $review2 = mysqli_real_escape_string($link,$review2); | |
335 $review3 = mysqli_real_escape_string($link,$review3); | |
336 | |
337 if($title != "") | |
338 { | |
339 $queryInsert = "CALL b_addNewBook(\"$searchparameterdata\",\"$title\", \"$author\",\"$binding\",\"$imageURL\", $dewey, $salesRank,\"$pubDate\",\"$publisher\",$g1,$g2,$g3,$loc)"; | |
340 //echo $queryInsert; | |
341 $queryInsertReviews = "CALL b_insertReviews(\"$searchparameterdata\",\"$review1\",\"$review2\",\"$review3\")"; | |
342 | |
343 $resG = mysqli_query($link, $queryInsert) or exit( mysqli_error( $link )); | |
344 if($review1 != "" && $review2 != "" && $review3 != "") | |
345 $resG = mysqli_query($link, $queryInsertReviews) or exit( mysqli_error( $link )); | |
346 | |
347 mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop | |
348 } | |
349 | |
350 echo $output; | |
351 } | |
352 } | |
353 else | |
354 { | |
355 //look up info from db | |
356 include "../../private/db.php"; | |
357 $query = "CALL b_getBookInfo('$searchparameterdata', $loc)"; | |
358 //echo $query; | |
359 $res = mysqli_query($link, $query) or exit( mysqli_error( $link )); | |
360 | |
361 $output = ""; | |
362 $output .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; | |
363 $output .= "<Details>"; | |
364 if ( mysqli_num_rows( $res ) > 0 ) | |
365 { | |
366 $rows=mysqli_fetch_array($res, MYSQLI_ASSOC); | |
367 | |
368 $output .= "<ASIN>" . $searchparameterdata . "</ASIN>"; | |
369 $output .= "<Title>" . htmlspecialchars($rows["Title"]) . "</Title>"; | |
370 $output .= "<Author>" . htmlspecialchars($rows["Author"]) . "</Author>"; | |
371 $output .= "<Binding>" . htmlspecialchars($rows["Binding"]) . "</Binding>"; | |
372 $output .= "<Dewey>" . htmlspecialchars($rows["DeweyDecimal"]) . "</Dewey>"; | |
373 $output .= "<ImageURL>" . htmlspecialchars($rows["ImageURL"]) . "</ImageURL>"; | |
374 $output .= "<SalesRank>" . htmlspecialchars($rows["SalesRank"]) . "</SalesRank>"; | |
375 $output .= "<PublicationDate>" . htmlspecialchars($rows["PublicationDate"]) . "</PublicationDate>"; | |
376 $output .= "<Publisher>" . htmlspecialchars($rows["Publisher"]) . "</Publisher>"; | |
377 $output .= "<Genre1>" . htmlspecialchars($rows["Genre1"]) . "</Genre1>"; | |
378 $output .= "<Genre2>" . htmlspecialchars($rows["Genre2"]) . "</Genre2>"; | |
379 $output .= "<Genre3>" . htmlspecialchars($rows["Genre3"]) . "</Genre3>"; | |
380 $output .= "<ProductGroup>Book</ProductGroup>"; | |
381 $output .= "<Error>AccountLimitExceeded</Error>"; | |
382 | |
383 } | |
384 $output .= "</Details>"; | |
385 echo $output; | |
386 } | |
387 } | |
388 | |
389 function findGenre($browseNode, &$ID, &$gen) | |
390 { | |
391 if($browseNode->Name == "Subjects") | |
392 { | |
393 return true; | |
394 } | |
395 else | |
396 { | |
397 if($browseNode->Ancestors->BrowseNode) | |
398 { | |
399 if(findGenre($browseNode->Ancestors->BrowseNode, $ID, $gen) == true) | |
400 { | |
401 $gen = $browseNode->Name; | |
402 $ID = $browseNode->BrowseNodeId; | |
403 } | |
404 } | |
405 return false; | |
406 } | |
407 } | |
408 | |
409 if(!isset($ret)) | |
410 { | |
411 include "aws_signed_request.php"; | |
412 getAmazonDet('default',0,'us'); //will get overwritten | |
413 } | |
414 /*Caught oneSimpleXMLElement Object | |
415 ( | |
416 [OperationRequest] => SimpleXMLElement Object | |
417 ( | |
418 [RequestId] => d2eaacba-2411-44e7-b268-f23a20167330 | |
419 [Arguments] => SimpleXMLElement Object | |
420 ( | |
421 [Argument] => Array | |
422 ( | |
423 [0] => SimpleXMLElement Object | |
424 ( | |
425 [@attributes] => Array | |
426 ( | |
427 [Name] => AWSAccessKeyId | |
17
ae1459564f66
Replace old associate keys with new IAMs user keys
Robert Boland <robert@markup.co.uk>
parents:
11
diff
changeset
|
428 [Value] => AKIAIHTNWC7L6LOUY4LQ |
4 | 429 ) |
430 | |
431 ) | |
432 | |
433 [1] => SimpleXMLElement Object | |
434 ( | |
435 [@attributes] => Array | |
436 ( | |
437 [Name] => AssociateTag | |
438 [Value] => bookwhack-21 | |
439 ) | |
440 | |
441 ) | |
442 | |
443 [2] => SimpleXMLElement Object | |
444 ( | |
445 [@attributes] => Array | |
446 ( | |
447 [Name] => ItemId | |
448 [Value] => B004Q3Q3Y4 | |
449 ) | |
450 | |
451 ) | |
452 | |
453 [3] => SimpleXMLElement Object | |
454 ( | |
455 [@attributes] => Array | |
456 ( | |
457 [Name] => ItemPage | |
458 [Value] => 1 | |
459 ) | |
460 | |
461 ) | |
462 | |
463 [4] => SimpleXMLElement Object | |
464 ( | |
465 [@attributes] => Array | |
466 ( | |
467 [Name] => Operation | |
468 [Value] => ItemLookup | |
469 ) | |
470 | |
471 ) | |
472 | |
473 [5] => SimpleXMLElement Object | |
474 ( | |
475 [@attributes] => Array | |
476 ( | |
477 [Name] => ResponseGroup | |
478 [Value] => ItemAttributes,Reviews,EditorialReview,OfferSummary,Offers,Images,AlternateVersions,SalesRank,BrowseNodes | |
479 ) | |
480 | |
481 ) | |
482 | |
483 [6] => SimpleXMLElement Object | |
484 ( | |
485 [@attributes] => Array | |
486 ( | |
487 [Name] => ReviewSort | |
488 [Value] => -HelpfulVotes | |
489 ) | |
490 | |
491 ) | |
492 | |
493 [7] => SimpleXMLElement Object | |
494 ( | |
495 [@attributes] => Array | |
496 ( | |
497 [Name] => Service | |
498 [Value] => AWSECommerceService | |
499 ) | |
500 | |
501 ) | |
502 | |
503 [8] => SimpleXMLElement Object | |
504 ( | |
505 [@attributes] => Array | |
506 ( | |
507 [Name] => Timestamp | |
508 [Value] => 2016-12-15T23:12:34Z | |
509 ) | |
510 | |
511 ) | |
512 | |
513 [9] => SimpleXMLElement Object | |
514 ( | |
515 [@attributes] => Array | |
516 ( | |
517 [Name] => Version | |
518 [Value] => 2011-08-01 | |
519 ) | |
520 | |
521 ) | |
522 | |
523 [10] => SimpleXMLElement Object | |
524 ( | |
525 [@attributes] => Array | |
526 ( | |
527 [Name] => Signature | |
528 [Value] => SUXfFZHQ74Joc+WDLx87uzemTdtHijNohykqafJXYKQ= | |
529 ) | |
530 | |
531 ) | |
532 | |
533 ) | |
534 | |
535 ) | |
536 | |
537 [RequestProcessingTime] => 0.3518217620000000 | |
538 ) | |
539 | |
540 [Items] => SimpleXMLElement Object | |
541 ( | |
542 [Request] => SimpleXMLElement Object | |
543 ( | |
544 [IsValid] => True | |
545 [ItemLookupRequest] => SimpleXMLElement Object | |
546 ( | |
547 [IdType] => ASIN | |
548 [ItemId] => B004Q3Q3Y4 | |
549 [ResponseGroup] => Array | |
550 ( | |
551 [0] => ItemAttributes | |
552 [1] => Reviews | |
553 [2] => EditorialReview | |
554 [3] => OfferSummary | |
555 [4] => Offers | |
556 [5] => Images | |
557 [6] => AlternateVersions | |
558 [7] => SalesRank | |
559 [8] => BrowseNodes | |
560 ) | |
561 | |
562 [VariationPage] => All | |
563 ) | |
564 | |
565 [Errors] => SimpleXMLElement Object | |
566 ( | |
567 [Error] => SimpleXMLElement Object | |
568 ( | |
569 [Code] => AWS.InvalidParameterValue | |
570 [Message] => B004Q3Q3Y4 is not a valid value for ItemId. Please change this value and retry your request. | |
571 ) | |
572 | |
573 ) | |
574 | |
575 ) | |
576 | |
577 ) | |
578 | |
579 ) | |
580 */ | |
581 ?> |