From 86a67b5c9e6601bbef1c2f6ad4fdf615b58b2fe6 Mon Sep 17 00:00:00 2001 From: Rob Vella Date: Wed, 27 Jan 2021 01:23:52 -0800 Subject: [PATCH] Hubnet --- fetchData.php | 8 ++++++-- index.html | 2 +- streamServer.php | 6 ++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fetchData.php b/fetchData.php index a28ed35..76b161c 100644 --- a/fetchData.php +++ b/fetchData.php @@ -81,7 +81,7 @@ function fetchNodeInfoIRLP($node) { function fetchAllStarDb() { $dbFile = __DIR__.'/storage/allstar.txt'; - if (!file_exists($dbFile)) { + if (!file_exists($dbFile) || outdatedFile($dbFile)) { $db = file_get_contents("http://allmondb.allstarlink.org"); file_put_contents($dbFile, $db); return $db; @@ -93,7 +93,7 @@ function fetchAllStarDb() { function fetchIRLPDb() { $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"); file_put_contents("${dbFile}.zip", $db); shell_exec("/usr/bin/unzip -p ${dbFile}.zip > ${dbFile}"); @@ -102,3 +102,7 @@ function fetchIRLPDb() { return file_get_contents($dbFile); } +function outdatedFile($path) +{ + return time() - filemtime($path) > 3600; +} diff --git a/index.html b/index.html index 477b17e..1a16f88 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@
-

Who's Talking?

+

UK HUBNET Who's Talking?

diff --git a/streamServer.php b/streamServer.php index 054197b..b6e56b2 100644 --- a/streamServer.php +++ b/streamServer.php @@ -17,9 +17,7 @@ class Stream * @var array */ protected $hubs = [ - // !!!!!!!!!!!!!!!!!!!! - // IMPORTANT!!! PUT THE NODE #s YOU WANT TO MONITOR HERE!!!! - // !!!!!!!!!!!!!!!!!!!! + 47766,41522,'41522A',41223,41288,51288,48701,43845,41689 ]; /** @@ -80,7 +78,7 @@ class Stream public function getAllMonUri() { $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 // return "http://localhost/server.php"; // return __DIR__ . '/test.stream';