ausaid scraper
[disclosr.git] / documents / disclogsList.php
blob:a/documents/disclogsList.php -> blob:b/documents/disclogsList.php
<?php <?php
   
include('template.inc.php'); include('template.inc.php');
include_header_documents(""); include_header_documents("");
include_once('../include/common.inc.php'); include_once('../include/common.inc.php');
   
echo "<table> echo "<table>
<tr><th>Agency Name</th><th>Disclosure Log URL recorded?</th><th>Do we monitor this URL?</th></tr>"; <tr><th>Agency Name</th><th>Disclosure Log URL recorded?</th><th>Do we monitor this URL?</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><b>" . $row->value->name . "</b> (".$row->id.")</td>\n"; echo "<tr><td><b>" . $row->value->name . "</b>";
  if ($ENV == "DEV")
echo "<td>"; echo "<br>(" . $row->id . ")";
if (isset($row->value->FOIDocumentsURL)) { echo "</td>\n";
echo '<a href="viewDocument.php?hash='.md5($row->value->FOIDocumentsURL).'">'  
.$row->value->FOIDocumentsURL.'</a>';  
} else { echo "<td>";
  if (isset($row->value->FOIDocumentsURL)) {
  echo '<a href="' . $row->value->FOIDocumentsURL . '">'
  . $row->value->FOIDocumentsURL . '</a>';
  if ($ENV == "DEV")
  echo '<br><small>(<a href="viewDocument.php?hash=' . md5($row->value->FOIDocumentsURL) . '">'
  . 'view local copy</a>)</small>';
  } else {
echo "<font color='red'>✘</font>"; echo "<font color='red'>✘</font>";
} }
echo "</td>\n<td>"; echo "</td>\n<td>";
if (isset($row->value->FOIDocumentsURL)) { if (isset($row->value->FOIDocumentsURL)) {
if (file_exists("./scrapers/".$row->id.'.py')) { if (file_exists("./scrapers/" . $row->id . '.py')) {
echo "<font color='green'>✔</font>"; echo "<font color='green'>✔</font>";
} else if (file_exists("./scrapers/".$row->id.'.txt')){ } else if (file_exists("./scrapers/" . $row->id . '.txt')) {
echo "<font color='blue'><b>▬</b></font>"; echo "<font color='blue'><b>▬</b></font>";
} else { } else {
echo "<font color='red'>✘</font>"; echo "<font color='red'>✘</font>";
} }
} }
echo "</td></tr>\n"; echo "</td></tr>\n";
} }
} }
} catch (SetteeRestClientException $e) { } catch (SetteeRestClientException $e) {
setteErrorHandler($e); setteErrorHandler($e);
} }
echo "</table>"; echo "</table>";
include_footer_documents(); include_footer_documents();
?> ?>