Update '12/liveplayer.js'

master
murtaugh 5 years ago
parent 5bf12e5dbd
commit b244ef0093

@ -1,9 +1,16 @@
(function () {
var last_timestamp;
async function poll () {
var d = await (await fetch("/cgi-bin/radioimplicancies.cgi")).json();
console.log("d", d);
var rows = await (await fetch("/cgi-bin/radioimplicancies.cgi")).json();
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);

Loading…
Cancel
Save