Update '12/liveplayer.js'

master
murtaugh 4 years ago
parent 5bf12e5dbd
commit b244ef0093

@ -1,9 +1,16 @@
(function () { (function () {
var last_timestamp;
async function poll () { async function poll () {
var d = await (await fetch("/cgi-bin/radioimplicancies.cgi")).json(); var rows = await (await fetch("/cgi-bin/radioimplicancies.cgi")).json();
console.log("d", d); console.log("rows", rows);
if (rows) {
// get the last (most recent) item
var d = rows[rows.length-1];
if (d.time && d.time != last_timestamp) {
console.log("CURRENT METADATA", d);
last_timestamp = d.time;
}
} }
window.setInterval(poll, 5000); window.setInterval(poll, 5000);

Loading…
Cancel
Save