comparison xml/getAmazonInfo.php @ 40:77ff181476b8

geoip fix?, better debugging
author Henry S. Thompson <ht@inf.ed.ac.uk>
date Sun, 30 Jul 2017 05:36:07 -0400
parents c9ebf871114b
children 0578c6e438d3
comparison
equal deleted inserted replaced
13:b78209a5fba1 40:77ff181476b8
62 ), 62 ),
63 ); 63 );
64 64
65 //if(go != 1) 65 //if(go != 1)
66 //include "aws_signed_request.php"; 66 //include "aws_signed_request.php";
67 67 $public_key ="AKIAIHTNWC7L6LOUY4LQ";
68 $public_key ="AKIAJBXEHTNCU6LLFNIA"; 68 $private_key="zWQlIzndJDtXNfxEXH7K7YR7hzv3u77lOcqfqPde";
69 $private_key="Dgyv7aR6uGe3OtY95Dj6hHpDS/UEtyboMWpJchYA";
70
71 //for all parameters see if the user has overruled it or use the default 69 //for all parameters see if the user has overruled it or use the default
72 foreach ($Adefault as $i=>$d) { 70 foreach ($Adefault as $i=>$d) {
73 $$i=isset($_GET[$i])?$_GET[$i]:$d; 71 $$i=isset($_GET[$i])?$_GET[$i]:$d;
74 } 72 }
75 //this is the data that is used to form the request for AWS 73 //this is the data that is used to form the request for AWS
113 // HST added this 111 // HST added this
114 if (preg_match("<Error>",$output)) { 112 if (preg_match("<Error>",$output)) {
115 $xml = new SimpleXMLElement($output); 113 $xml = new SimpleXMLElement($output);
116 $resName=$xml->getName(); 114 $resName=$xml->getName();
117 $code=$xml->Error->Code; 115 $code=$xml->Error->Code;
118 file_put_contents('/var/ywww/debug/phpDebug',"Losing: $resName, $code\n",FILE_APPEND); 116 file_put_contents('/var/ywww/debug/phpDebug',"Losing (test): $resName, $code\n",FILE_APPEND);
119 if ($code=='RequestThrottled') { 117 if ($code=='RequestThrottled') {
120 usleep(200000); // Try to reduce throttling until we get a 118 usleep(200000); // Try to reduce throttling until we get a
121 // principled solution in place 119 // principled solution in place
122 } 120 }
123 else { 121 else {
124 file_put_contents('/var/ywww/debug/phpDebug',"parms: $go\n". 122 file_put_contents('/var/ywww/debug/phpDebug',"parms: $go\nurl: $url\n".
125 print_r($parameters,TRUE)."\n",FILE_APPEND); 123 print_r($parameters,TRUE)."\n",FILE_APPEND);
126 if ($code=="") { 124 if ($code=="") {
127 file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$output\n",FILE_APPEND); 125 file_put_contents('/var/ywww/debug/phpDebug',"error elt:\n$output\n",FILE_APPEND);
128 } 126 }
129 } 127 }
425 [0] => SimpleXMLElement Object 423 [0] => SimpleXMLElement Object
426 ( 424 (
427 [@attributes] => Array 425 [@attributes] => Array
428 ( 426 (
429 [Name] => AWSAccessKeyId 427 [Name] => AWSAccessKeyId
430 [Value] => AKIAJBXEHTNCU6LLFNIA 428 [Value] => AKIAIHTNWC7L6LOUY4LQ
431 ) 429 )
432 430
433 ) 431 )
434 432
435 [1] => SimpleXMLElement Object 433 [1] => SimpleXMLElement Object