42
|
1 <?php
|
|
2
|
|
3 include_once "doAmazonRequest.inc";
|
|
4
|
|
5 function getAmazonDet($isbn,$go,$localeIn)
|
|
6 {
|
|
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 //for all parameters see if the user has overruled it or use the default
|
|
24 foreach ($Adefault as $i=>$d) {
|
|
25 $$i=isset($_GET[$i])?$_GET[$i]:$d;
|
|
26 }
|
|
27 switch($locale){
|
|
28 case "us":
|
|
29 $loc = 0;
|
|
30 break;
|
|
31 case "uk":
|
|
32 $loc = 1;
|
|
33 break;
|
|
34 case "ca":
|
|
35 $loc = 2;
|
|
36 break;
|
|
37 case "de":
|
|
38 $loc = 3;
|
|
39 break;
|
|
40 case "fr":
|
|
41 $loc = 4;
|
|
42 break;
|
|
43 };
|
|
44
|
|
45 try {
|
|
46 return getAmazonDetRemote($go,$language,$locale,$loc,
|
|
47 $page,$operation,$searchparameter,
|
|
48 $searchparameterdata,
|
|
49 $show_array,$show_url,$show_xml);
|
|
50 }
|
|
51 catch (Exception $e) {
|
|
52 return getAmazonDetLocal($go,$language,$loc,
|
|
53 $page,$operation,$searchparameter,
|
|
54 $searchparameterdata,
|
|
55 $show_array,$show_url,$show_xml);
|
|
56 }
|
|
57 }
|
|
58
|
|
59 function getAmazonDetRemote($go,$language,$locale,$loc,
|
|
60 $page,$operation,$searchparameter,
|
|
61 $searchparameterdata,
|
|
62 $show_array,$show_url,$show_xml)
|
|
63 {
|
|
64 global $output, $Aassociates_id, $Aserver;
|
|
65
|
|
66 //if(go != 1)
|
|
67 //include "aws_signed_request.php";
|
|
68 //this is the data that is used to form the request for AWS
|
|
69 //this is the part that is search specific
|
|
70 $parameters=array(
|
|
71 'Operation' =>$operation ,
|
|
72 //'Keywords' =>urlencode($search) ,
|
|
73 "$searchparameter"=>$searchparameterdata ,
|
|
74 'ItemPage' =>$page , //which page?
|
|
75 'AssociateTag' =>$Aassociates_id[$locale],
|
|
76 'ResponseGroup' =>'ItemAttributes,Reviews,EditorialReview,OfferSummary,Offers,Images,AlternateVersions,SalesRank,BrowseNodes' , //Small, Medium, Large or SellerListing,'BrowseNodes',// ,
|
|
77 'ReviewSort' =>'-HelpfulVotes'
|
|
78 );
|
|
79
|
|
80 if (isset($searchindex) && $searchindex!='Books') {
|
|
81 // HST did this
|
|
82 // Used to be in $parameters init above, but
|
|
83 // that caused an error:
|
|
84 // If idType equals ASIN, SearchIndex cannot be present
|
|
85 //'SearchIndex' =>$searchindex , //Books for example.
|
|
86 $parameters['SearchIndex']=$searchindex;
|
|
87 }
|
|
88 $xml=doAmazonRequest($Aserver[$locale]['ext'],$parameters,3,'i'); // may throw exception
|
|
89 set_error_handler(function () {
|
|
90 global $output;
|
|
91 file_put_contents('/var/ywww/debug/phpDebug',
|
|
92 "Caught one?: ".$searchparameterdata,
|
|
93 FILE_APPEND);
|
|
94 file_put_contents('/var/ywww/debug/phpDebug',
|
|
95 print_r($output, TRUE)."\n",
|
|
96 FILE_APPEND);
|
|
97 } );
|
|
98 $review = $xml->Items->Item->CustomerReviews->IFrameURL;
|
|
99 restore_error_handler();
|
|
100 //echo $review;
|
|
101 if ($review != "")
|
|
102 {
|
|
103 $review1 = "";
|
|
104 $review2 = "";
|
|
105 $review3 = "";
|
|
106 $text = @file_get_contents($review . "&truncate=300");
|
|
107 $removeTop1 = preg_replace('~<div class="crIFrameHeaderLeftColumn">(.*?)<div class="crIFrameHeaderHistogram">~si', '', $text);
|
|
108 $removeTop2 = preg_replace('~<div class="crIFrameHeaderHistogram">(.*?)<div class="crIframeReviewList">~si', '', $text);
|
|
109 if (preg_match('~<body[^>]*>(.*?)</body>~si', $removeTop2, $body)){ $getBody = trim($body[1]); } else { $getBody = $removeTop2;}
|
|
110 $removeDiv = preg_replace('~<div[^>]*>(.*?)</div>~si', '', $getBody);
|
|
111 $removeCloseDivs = preg_replace('/<\/div>/','', $removeDiv);
|
|
112 $setBoundary = str_replace('<!-- BOUNDARY -->','BOTTOM-TOP', $removeCloseDivs);
|
|
113 //replace <!-- BOUNDARY --> with BOTTOM-TOP
|
|
114 $remove1 = '~<table cellpadding="0"(.*?)%">~s';
|
|
115 $setBoundary = preg_replace($remove1,'', $setBoundary);
|
|
116 $remove2 = '~</td><td bg(.*?)</table>~s';
|
|
117 $setBoundary = preg_replace($remove2,'', $setBoundary);
|
|
118 $remove3 = '~<a name=(.*?)</a>~s';
|
|
119 $setBoundary = preg_replace($remove3,'', $setBoundary);
|
|
120 $setBoundary2 = str_replace('<br />','', $setBoundary);
|
|
121 //remove all extra crap;
|
|
122 $setBoundary3 = str_replace('</td>','BOTTOM', $setBoundary2);
|
|
123 //replace </td> with BOTTOM
|
|
124
|
|
125 if (preg_match_all('~TOP(.*?)BOTTOM~s', $setBoundary3, $reviews))
|
|
126 {
|
|
127 $reviewContents = $reviews[1];
|
|
128 //print_r($reviewContents);
|
|
129 $review1 = trim($reviewContents[0]);
|
|
130 $review1 = str_replace("\n", "", $review1);
|
|
131 $review1 = str_replace("\r", "", $review1);
|
|
132 if (isset($reviewContents[1])) {
|
|
133 $review2 = trim($reviewContents[1]);
|
|
134 $review2 = str_replace("\n", "", $review2);
|
|
135 $review2 = str_replace("\r", "", $review2);
|
|
136 }
|
|
137 else {
|
|
138 $review2 = "";
|
|
139 }
|
|
140 if (isset($reviewContents[2])) {
|
|
141 $review3 = trim($reviewContents[2]);
|
|
142 $review3 = str_replace("\n", "", $review3);
|
|
143 $review3 = str_replace("\r", "", $review3);
|
|
144 }
|
|
145 else {
|
|
146 $review3 = "";
|
|
147 }
|
|
148 }
|
|
149 else
|
|
150 {
|
|
151 $review1 = "";
|
|
152 $review2 = "";
|
|
153 $review3 = "";
|
|
154 //echo "EPIC FAIL";
|
|
155 }
|
|
156
|
|
157 unset($xml->Items->Item->CustomerReviews);
|
|
158 $xdoc = new DomDocument;
|
|
159 $xdoc->loadXML($xml->asXML());
|
|
160
|
|
161 $cReviews = $xdoc ->createElement('CustomerReviews');
|
|
162 $cReviewHolder = $xdoc ->createElement('Review');
|
|
163 $cReview = $xdoc ->createElement('Content');
|
|
164 $cReviewHolder2 = $xdoc ->createElement('Review');
|
|
165 $cReview2 = $xdoc ->createElement('Content');
|
|
166 $cReviewHolder3 = $xdoc ->createElement('Review');
|
|
167 $cReview3 = $xdoc ->createElement('Content');
|
|
168
|
|
169 $txtNode = $xdoc ->createTextNode ($review1);
|
|
170 $cReview -> appendChild($txtNode);
|
|
171
|
|
172 $txtNode2 = $xdoc ->createTextNode ($review2);
|
|
173 $cReview2 -> appendChild($txtNode2);
|
|
174
|
|
175 $txtNode3 = $xdoc ->createTextNode ($review3);
|
|
176 $cReview3 -> appendChild($txtNode3);
|
|
177
|
|
178 $cReviewHolder -> appendChild($cReview);
|
|
179 $cReviewHolder2 -> appendChild($cReview2);
|
|
180 $cReviewHolder3 -> appendChild($cReview3);
|
|
181
|
|
182 $cReviews -> appendChild($cReviewHolder);
|
|
183 $cReviews -> appendChild($cReviewHolder2);
|
|
184 $cReviews -> appendChild($cReviewHolder3);
|
|
185
|
|
186 $xdoc->documentElement->childNodes->item(1)->childNodes->item(1)->appendChild($cReviews);
|
|
187 $newXML = simplexml_import_dom($xdoc);
|
|
188 $output = $newXML->asXml();
|
|
189 }
|
|
190
|
|
191 if($go == 1) {
|
|
192 $item = $xml->Items->Item[0];
|
|
193 if ($item && $item->ItemAttributes && $item->ItemAttributes->Title) {
|
|
194 $title = $item->ItemAttributes->Title; }
|
|
195 else { $title = "[no title]"; };
|
|
196 file_put_contents('/var/ywww/debug/phpDebug',"win: $title\n",
|
|
197 FILE_APPEND);
|
|
198 return $output;
|
|
199 }
|
|
200 else {
|
|
201 if ($xml->Items->Item) {
|
|
202 $title = $xml->Items->Item[0]->ItemAttributes->Title;
|
|
203 $author = $xml->Items->Item[0]->ItemAttributes->Author;
|
|
204 $binding = $xml->Items->Item[0]->ItemAttributes->Binding;
|
|
205 $dewey = $xml->Items->Item[0]->ItemAttributes->DeweyDecimalNumber;
|
|
206 if($dewey == "")
|
|
207 $dewey = "null";
|
|
208 $imageURL = $xml->Items->Item[0]->MediumImage->URL;
|
|
209 $salesRank = $xml->Items->Item[0]->SalesRank;
|
|
210 $pubDate = $xml->Items->Item[0]->ItemAttributes->PublicationDate;
|
|
211 if (strlen($pubDate)==4) { $pubDate=$pubDate."-01-01";}
|
|
212 if (strlen($pubDate)==7) { $pubDate=$pubDate."-01";}
|
|
213 if (strlen($pubDate)==0) {
|
|
214 $pubDate="null";
|
|
215 }
|
|
216 else {
|
|
217 $pubDate="\"$pubDate\"";
|
|
218 }
|
|
219 $publisher = $xml->Items->Item[0]->ItemAttributes->Publisher;
|
|
220 }
|
|
221 else {
|
|
222 $title = $salesRank = "";
|
|
223 $dewey = "null";
|
|
224 }
|
|
225
|
|
226 $genreID = "";
|
|
227 $genre = "";
|
|
228 $genArr = array();
|
|
229
|
|
230 if ($xml->Items->Item[0] && $xml->Items->Item[0]->BrowseNodes) {
|
|
231 for($i=0;$i<sizeof($xml->Items->Item->BrowseNodes->BrowseNode);$i++){
|
|
232 //sexy recursive function
|
|
233 findGenre($xml->Items->Item->BrowseNodes->BrowseNode[$i], $genreID, $genre);
|
|
234
|
|
235 if($genre != "")
|
|
236 $genArr[strval($genreID)] = strval($genre);
|
|
237 //$genArr[$i] = array(strval($genreID) => strval($genre));
|
|
238
|
|
239 //echo $genre;
|
|
240 //echo $genreID;
|
|
241
|
|
242 $genre = "";
|
|
243 $genreID = "";
|
|
244 }
|
|
245 }
|
|
246
|
|
247 $g1 = "null";
|
|
248 $g2 = "null";
|
|
249 $g3 = "null";
|
|
250 $loop = 1;
|
|
251
|
|
252 foreach ($genArr as $key => $value) {
|
|
253 //echo "$key => $value";
|
|
254 if ($key>2047) {
|
|
255 //HST added
|
|
256 break;
|
|
257 }
|
|
258 $queryG = "CALL b_addBrowseNode($key,\"$value\")"; //add the name value pair for genre to new table
|
|
259 //echo $queryG;
|
|
260 include "../../private/db.php";
|
|
261 $resG = mysqli_query($link, $queryG);
|
|
262 mysqli_close($link);
|
|
263
|
|
264 switch ($loop) {
|
|
265 case 1:
|
|
266 $g1 = $key;
|
|
267 break;
|
|
268 case 2:
|
|
269 $g2 = $key;
|
|
270 break;
|
|
271 case 3:
|
|
272 $g3 = $key;
|
|
273 break;
|
|
274 }
|
|
275
|
|
276 $loop++;
|
|
277 }
|
|
278
|
|
279 if($salesRank == "")
|
|
280 $salesRank = "null";
|
|
281
|
|
282 if($title != "")
|
|
283 {
|
|
284 include "../../private/db.php";
|
|
285 if ($publisher->count()==0) {
|
|
286 $publisher="null";
|
|
287 }
|
|
288 else {
|
|
289 $publisher=mysqli_real_escape_string($link,$publisher);
|
|
290 if (strlen($publisher)>30) {
|
|
291 $publisher=rtrim(substr($publisher,0,30),"\\");
|
|
292 }
|
|
293 $publisher="\"".$publisher."\"";
|
|
294 }
|
|
295 if ($author->count()==0) {
|
|
296 $author="unknown";
|
|
297 }
|
|
298 else {
|
|
299 $author=mysqli_real_escape_string($link,$author);
|
|
300 if (strlen($author)>30) {
|
|
301 $author=rtrim(substr($author,0,30),"\\");
|
|
302 }
|
|
303 }
|
|
304 $author="\"".$author."\"";
|
|
305 $title=mysqli_real_escape_string($link,$title);
|
|
306 if (strlen($title)>100) {
|
|
307 $title=rtrim(substr($title,0,100),"\\");
|
|
308 }
|
|
309 $title="\"".$title."\"";
|
|
310 $review1 = mysqli_real_escape_string($link,$review1);
|
|
311 if (strlen($review1)>500) { $review1=rtrim(substr($review1,0,500),"\\");}
|
|
312 $review2 = mysqli_real_escape_string($link,$review2);
|
|
313 if (strlen($review2)>500) { $review2=rtrim(substr($review2,0,500),"\\");}
|
|
314 $review3 = mysqli_real_escape_string($link,$review3);
|
|
315 if (strlen($review3)>500) { $review3=rtrim(substr($review3,0,500),"\\");}
|
|
316
|
|
317 $queryInsert = "CALL b_addNewBook(\"$searchparameterdata\",$title, $author,\"$binding\",\"$imageURL\", $dewey, $salesRank,$pubDate,$publisher,$g1,$g2,$g3,$loc)";
|
|
318 //echo $queryInsert;
|
|
319
|
|
320 $res = mysqli_query($link, $queryInsert);
|
|
321 if (!$res) {
|
|
322 $err=mysqli_error( $link );
|
|
323 mysqli_close($link);
|
|
324 file_put_contents('/var/ywww/debug/phpDebug',
|
|
325 "anb failed: $queryInsert\n$err\n",
|
|
326 FILE_APPEND);
|
|
327 exit($err);
|
|
328 }
|
|
329 $queryInsertReviews = "CALL b_insertReviews(\"$searchparameterdata\",\"$review1\",\"$review2\",\"$review3\")";
|
|
330 if($review1 != "") {
|
|
331 $res = mysqli_query($link, $queryInsertReviews);
|
|
332 if (!$res) {
|
|
333 $err=mysqli_error( $link );
|
|
334 mysqli_close($link);
|
|
335 file_put_contents('/var/ywww/debug/phpDebug',
|
|
336 "anr failed: $queryInsertReviews\n",
|
|
337 FILE_APPEND);
|
|
338 exit($err);
|
|
339 }
|
|
340 }
|
|
341 mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop
|
|
342 }
|
|
343
|
|
344 echo $output;
|
|
345 }
|
|
346 }
|
|
347
|
|
348 function getAmazonDetLocal($go,$language,$loc,
|
|
349 $page,$operation,$searchparameter,
|
|
350 $searchparameterdata,
|
|
351 $show_array,$show_url,$show_xml)
|
|
352 {
|
|
353 global $output;
|
|
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 mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop
|
|
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 else {
|
|
384 mysqli_close($link); //do not remove. reset is needed otherwise mysqli_fetch_array doesn't work after first loop
|
|
385 }
|
|
386 $output .= "</Details>";
|
|
387 echo $output;
|
|
388 }
|
|
389
|
|
390 function findGenre($browseNode, &$ID, &$gen)
|
|
391 {
|
|
392 if($browseNode->Name == "Subjects")
|
|
393 {
|
|
394 return true;
|
|
395 }
|
|
396 else
|
|
397 {
|
|
398 if($browseNode->Ancestors->BrowseNode)
|
|
399 {
|
|
400 if(findGenre($browseNode->Ancestors->BrowseNode, $ID, $gen) == true)
|
|
401 {
|
|
402 $gen = $browseNode->Name;
|
|
403 $ID = $browseNode->BrowseNodeId;
|
|
404 }
|
|
405 }
|
|
406 return false;
|
|
407 }
|
|
408 }
|
|
409
|
|
410 if(!isset($ret))
|
|
411 {
|
|
412 include "aws_signed_request.php";
|
|
413 getAmazonDet('default',0,'us'); //will get overwritten from URI params
|
|
414 // by the foreach ($Adefault as ... loop above
|
|
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] => AKIAIHTNWC7L6LOUY4LQ
|
|
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 /*$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>");*/
|
|
584 ?>
|