annotate xml/getAmazonInfo.php @ 4:a6b55ae70617

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