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