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