diff --git a/actions.js b/actions.js index 6c27312..da5fd25 100755 --- a/actions.js +++ b/actions.js @@ -73,16 +73,23 @@ function Process(d, file) { function ProcessIncomingRequest(data) { - logger.Log("[PCES] ----------------------------------------------------------<", - logger.GetColor("yellow")); if (data == undefined) { logger.Log("[PCES]:\tRecieved data is undefined!", logger.GetColor("redbg")); return; } var d = SetupData(data); + var qcount = -1; + try { + var splitted = d.alldata.split("\n"); + var count = 0; + for (var i = 0; i < splitted.length; i++) + if (splitted[i][0] == '?') + count ++; + qcount = count; + } catch (e) {console.log("Error :c"); console.log(e);} - logger.Log("[PCES]:\tProcessing data: " + d.subj + " (" + d.type + ")", logger.GetColor("green")); + logger.Log("[PCES]:\tProcessing data: " + d.subj + " (" + d.type + "), count: " + qcount, logger.GetColor("green")); if (d.subj == undefined){ logger.Log(JSON.stringify(d), logger.GetColor("red")); return; @@ -99,22 +106,12 @@ function ProcessIncomingRequest(data) { Process(d, publicFile); Process(d, staticFile); }*/ - try { - var splitted = d.alldata.split("\n"); - var count = 0; - for (var i = 0; i < splitted.length; i++) - if (splitted[i][0] == '?') - count ++; - logger.Log("[PCES]:\tTest all question count: " + count, logger.GetColor("blue")); - } catch (e) {console.log("Error :c"); console.log(e);} var newPubItems = Process(d, publicFile); var newStatItems = Process(d, staticFile); utils.AppendToFile(logger.GetDateString() + "\n" + d.data, recievedFile); PrintNewCount(d, newPubItems, publicFile); PrintNewCount(d, newStatItems, staticFile); - logger.Log("[PCES] ----------------------------------------------------------<", - logger.GetColor("yellow")); } function PrintNewCount(d, newItems, file) { diff --git a/views/main.ejs b/views/main.ejs index d5bee92..8cb7337 100755 --- a/views/main.ejs +++ b/views/main.ejs @@ -33,6 +33,8 @@ greasyforkon