# HG changeset patch # User Henry Thompson # Date 1487344973 0 # Node ID 226f00d9f6f571d6d01cba1729b7df9c1b949055 # Parent 1dfe64e365a01f42f6a13e7a9a451539d397a0be another error check diff -r 1dfe64e365a0 -r 226f00d9f6f5 us/index.php --- a/us/index.php Fri Feb 17 13:40:20 2017 +0000 +++ b/us/index.php Fri Feb 17 15:22:53 2017 +0000 @@ -140,8 +140,22 @@ { $bookDetails = getAmazonDet($isbn,1,'us'); $bookXML = new SimpleXMLElement($bookDetails); - $title = $bookXML->Items->Item[0]->ItemAttributes->Title; - $author = $bookXML->Items->Item[0]->ItemAttributes->Author; + // HST added this + if (preg_match("",$bookDetails)) { + $resName=$bookXML->getName(); + $code=$bookXML->Error->Code; + file_put_contents('/var/ywww/debug/phpDebug',"Losing 3: $resName, ". + $code."\n",FILE_APPEND); + if ($code=='RequestThrottled') { + usleep(200000); // Try to reduce throttling until we get a + // principled solution in place + } + $title = ""; + } + else { + $title = $bookXML->Items->Item[0]->ItemAttributes->Title; + $author = $bookXML->Items->Item[0]->ItemAttributes->Author; + } } $linkedBooks = include "../php/read/getLinkedBooks.php";