This commit is contained in:
Rob Vella 2021-01-27 01:23:52 -08:00
parent a2c3bf6872
commit 86a67b5c9e
3 changed files with 9 additions and 7 deletions

View File

@ -81,7 +81,7 @@ function fetchNodeInfoIRLP($node) {
function fetchAllStarDb() { function fetchAllStarDb() {
$dbFile = __DIR__.'/storage/allstar.txt'; $dbFile = __DIR__.'/storage/allstar.txt';
if (!file_exists($dbFile)) { if (!file_exists($dbFile) || outdatedFile($dbFile)) {
$db = file_get_contents("http://allmondb.allstarlink.org"); $db = file_get_contents("http://allmondb.allstarlink.org");
file_put_contents($dbFile, $db); file_put_contents($dbFile, $db);
return $db; return $db;
@ -93,7 +93,7 @@ function fetchAllStarDb() {
function fetchIRLPDb() { function fetchIRLPDb() {
$dbFile = __DIR__.'/storage/irlp.txt'; $dbFile = __DIR__.'/storage/irlp.txt';
if (!file_exists($dbFile)) { if (!file_exists($dbFile) || outdatedFile($dbFile)) {
$db = file_get_contents("http://status.irlp.net/nohtmlstatus.txt.zip"); $db = file_get_contents("http://status.irlp.net/nohtmlstatus.txt.zip");
file_put_contents("${dbFile}.zip", $db); file_put_contents("${dbFile}.zip", $db);
shell_exec("/usr/bin/unzip -p ${dbFile}.zip > ${dbFile}"); shell_exec("/usr/bin/unzip -p ${dbFile}.zip > ${dbFile}");
@ -102,3 +102,7 @@ function fetchIRLPDb() {
return file_get_contents($dbFile); return file_get_contents($dbFile);
} }
function outdatedFile($path)
{
return time() - filemtime($path) > 3600;
}

View File

@ -13,7 +13,7 @@
<div id="app"> <div id="app">
<div class="header"> <div class="header">
<div class="text-center"> <div class="text-center">
<h1>Who's Talking?</h1> <h1>UK HUBNET Who's Talking?</h1>
<button v-cloak class="pure-button pure-button-primary" @click="toggleTail" :class="{ 'button-error': enabled }"> <button v-cloak class="pure-button pure-button-primary" @click="toggleTail" :class="{ 'button-error': enabled }">
{{ enabled ? "Stop" : "Start" }} Log {{ enabled ? "Stop" : "Start" }} Log
</button> </button>

View File

@ -17,9 +17,7 @@ class Stream
* @var array * @var array
*/ */
protected $hubs = [ protected $hubs = [
// !!!!!!!!!!!!!!!!!!!! 47766,41522,'41522A',41223,41288,51288,48701,43845,41689
// IMPORTANT!!! PUT THE NODE #s YOU WANT TO MONITOR HERE!!!!
// !!!!!!!!!!!!!!!!!!!!
]; ];
/** /**
@ -80,7 +78,7 @@ class Stream
public function getAllMonUri() public function getAllMonUri()
{ {
$hubsStr = implode(",", $this->hubs); $hubsStr = implode(",", $this->hubs);
return "http://localhost/allmon2/server.php?nodes=" . $hubsStr; return "https://www.hubnetwork.uk/pubmon-web/server.php?nodes=" . $hubsStr;
// Use this return if you want all nodes // Use this return if you want all nodes
// return "http://localhost/server.php"; // return "http://localhost/server.php";
// return __DIR__ . '/test.stream'; // return __DIR__ . '/test.stream';