scraper monitoring page
[disclosr.git] / documents / checkScrapers.php
blob:a/documents/checkScrapers.php -> blob:b/documents/checkScrapers.php
--- a/documents/checkScrapers.php
+++ b/documents/checkScrapers.php
@@ -1,1 +1,31 @@
+<?php
 
+include_once('../include/common.inc.php');
+include_header('Webserver and Accessiblity');
+
+echo "<table>
+    <tr><th>name</th><th>webserver</th><th>accessiblity errors</th></tr>";
+$agenciesdb = $server->get_db('disclosr-agencies');
+$docsdb = $server->get_db('disclosr-documents');
+try {
+    $rows = $agenciesdb->get_view("app", "byCanonicalName", null, true)->rows;
+
+
+    if ($rows) {
+        foreach ($rows as $row) {
+
+            echo "<tr><td>" . $row->value->name . "</td>\n";
+             echo "<td>";
+             if (isset($row->value->FOIDocumentsURL)) {
+                 echo '<a href="viewDocument.php?hash='.md5($row->value->FOIDocumentsURL).'">'
+                     .$row->value->FOIDocumentsURL.'</a>';
+             }
+            echo "</td>\n";
+            echo "</tr>\n";
+        }
+    }
+} catch (SetteeRestClientException $e) {
+    setteErrorHandler($e);
+}
+include_footer();
+?>