podcrawler.php 310 Bytes
Newer Older
David Morley's avatar
David Morley committed
1 2
<?php

dmorley's avatar
dmorley committed
3 4 5 6 7 8
if (php_sapi_name() == "cli") {
  $json = json_decode(file_get_contents('https://the-federation.info/pods.json'));
  if ($json) {
    foreach ($json->pods ?? [] as $poddata) {
      echo exec("php-cgi db/add.php domain={$poddata->host}") . "\r\n";
    }
dmorley's avatar
dmorley committed
9
  }
dmorley's avatar
dmorley committed
10 11
} else {
header('HTTP/1.0 403 Forbidden');
David Morley's avatar
David Morley committed
12
}