From f00ba92ed2cc1a9c24ad783e83525d1b5a85b857 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 13 Sep 2016 11:43:06 +0200 Subject: Initial --- modules/nlen/nlen.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 modules/nlen/nlen.js (limited to 'modules/nlen/nlen.js') diff --git a/modules/nlen/nlen.js b/modules/nlen/nlen.js new file mode 100644 index 0000000..c988105 --- /dev/null +++ b/modules/nlen/nlen.js @@ -0,0 +1,17 @@ +var cmn=require("../$common.js"), + fs=require("fs"); + +var translations; + +module.exports=function(app,io,moddir){ + translations=eval(String(fs.readFileSync(moddir+"/English-Dutch-mistranslations.json"))); + app.get("/nlen",function(req,res){ + var translation=translations[+new Date()/60000%translations.length|0]; //new translation each minute + res.set('Content-Type', 'text/html'); + res.send( + String(fs.readFileSync(moddir+"/nlen.html")) + .replace("",cmn.simpleHTMLescape(translation.nl)) + .replace("",cmn.simpleHTMLescape(translation.en)) + ); + }); +}; -- cgit v1.2.3-54-g00ecf