added colors to scrapers validator
added colors to scrapers validator


Former-commit-id: ab47cd0593c47f1a2099381e7118267a82ce2fe3

<?php <?php
   
include_once('../include/common.inc.php'); include_once('../include/common.inc.php');
include_header('Webserver and Accessiblity'); include_header('Webserver and Accessiblity');
   
echo "<table> echo "<table>
<tr><th>name</th><th>webserver</th><th>accessiblity errors</th></tr>"; <tr><th>name</th><th>disclog</th><th>scraper?</th></tr>";
$agenciesdb = $server->get_db('disclosr-agencies'); $agenciesdb = $server->get_db('disclosr-agencies');
$docsdb = $server->get_db('disclosr-documents'); $docsdb = $server->get_db('disclosr-documents');
try { try {
$rows = $agenciesdb->get_view("app", "byCanonicalName", null, true)->rows; $rows = $agenciesdb->get_view("app", "byCanonicalName", null, true)->rows;
   
   
if ($rows) { if ($rows) {
foreach ($rows as $row) { foreach ($rows as $row) {
   
echo "<tr><td>" . $row->value->name . "</td>\n"; echo "<tr><td>" . $row->value->name . " (".$row->id.")</td>\n";
echo "<td>"; echo "<td>";
if (isset($row->value->FOIDocumentsURL)) { if (isset($row->value->FOIDocumentsURL)) {
echo '<a href="viewDocument.php?hash='.md5($row->value->FOIDocumentsURL).'">' echo '<a href="viewDocument.php?hash='.md5($row->value->FOIDocumentsURL).'">'
.$row->value->FOIDocumentsURL.'</a>'; .$row->value->FOIDocumentsURL.'</a>';
} } else {
echo "</td>\n"; echo "<font color='red'>✘</font>";
echo "</tr>\n"; }
  echo "</td>\n<td>";
  if (isset($row->value->FOIDocumentsURL)) {
  if (file_exists("./scrapers/".$row->id.'.py')) {
  echo "<font color='green'>✔</font>";
  } else if (file_exists("./scrapers/".$row->id.'.txt')){
  echo "pass";
  } else {
  echo "<font color='red'>✘</font>";
  }
  }
  echo "</td></tr>\n";
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
include_footer(); include_footer();
?> ?>