CREATE TABLE "main"."urls" ( // ...> "URL" text NOT NULL, // ...> PRIMARY KEY("URL") // ...> ); // sqlite> .quit // sh$ // The folder on the webserver will contain the following: // simStatus.php // simStatus.sqlite // Enjoy. [WaS-K] // For privacy, you need to generate a password. You can do that // by issuing the following command on an *nix-like system and // replace "super-duper secret password" with a secret shared between // this PHP script and the LSL counterpart: // sh$ echo "super-duper secret password" | sha1sum | awk '{ print $1 }' $apiKey = 'bbd16d2772593ea5f890973c027dbc7f4a096164'; if(isset($_GET['url']) && isset($_GET['key'])) { if($_GET['key'] != $apiKey) die; $llURL = $_GET['url']; $db = new PDO('sqlite:simStatus.sqlite'); $q = $db->prepare("REPLACE INTO urls(URL) VALUES(:url)"); try { $q->execute(array(':url' => $llURL)); } catch(PDOException $e) { print $e->getMessage(); } return 'OK'; } $db = new PDO('sqlite:simStatus.sqlite'); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $q = $db->prepare("SELECT URL FROM urls"); $q->execute(); while($res = $q->fetchObject()) { $req = new HttpRequest($res->URL, HttpRequest::METH_GET); try { $req->send(); } catch(HttpException $ex) { print $ex; die; } if($req->getResponseCode() != 200) { $d = $db->prepare("DELETE FROM urls WHERE URL=:url"); $d->execute(array(':url' => $res->URL)); continue; } $simStatus = json_decode(json_encode(simplexml_load_string($req->getResponseBody())),TRUE); } ?>