From 9143f71155c25ec37b329d67c52f109464be6695 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 18 Oct 2020 19:37:10 +0200 Subject: Whatpulse hasn't worked for YEARS --- webserver.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/webserver.js b/webserver.js index 4b49412..3405431 100755 --- a/webserver.js +++ b/webserver.js @@ -27,24 +27,24 @@ const io = socketio(httpServer); // const reqlogger = new Logger("request_log.txt"); -const whatpulse = {"keys": "", "clicks": ""}; -function refreshWhatpulse() { - const url = "http://api.whatpulse.org/user.php?user=tomsmeding&format=json&formatted=yes"; - http.get(url, function (res) { - let body = ""; - res.on("data", function (data) { body += data; }); - res.on("end", function () { - try { body = JSON.parse(body); } - catch (e) { return; } - whatpulse.keys = body.Keys/*.replace(/,/g, " ")*/; - whatpulse.clicks = body.Clicks/*.replace(/,/g, " ")*/; - }); - }).on("error", function (err) { - console.log(`Whatpulse request error: ${err.message}`); - }); -} -setInterval(refreshWhatpulse, 6*3600*1000); //every 6 hours -refreshWhatpulse(); +// const whatpulse = {"keys": "", "clicks": ""}; +// function refreshWhatpulse() { +// const url = "http://api.whatpulse.org/user.php?user=tomsmeding&format=json&formatted=yes"; +// http.get(url, function (res) { +// let body = ""; +// res.on("data", function (data) { body += data; }); +// res.on("end", function () { +// try { body = JSON.parse(body); } +// catch (e) { return; } +// whatpulse.keys = body.Keys[>.replace(/,/g, " ")<]; +// whatpulse.clicks = body.Clicks[>.replace(/,/g, " ")<]; +// }); +// }).on("error", function (err) { +// console.log(`Whatpulse request error: ${err.message}`); +// }); +// } +// setInterval(refreshWhatpulse, 6*3600*1000); //every 6 hours +// refreshWhatpulse(); // function simpleLogEscape(str) { // return str -- cgit v1.2.3-70-g09d2