From 8bed4192558aa91cd8fe1ba501200b1c111e43e9 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 6 Oct 2017 17:32:47 +0200 Subject: Fix madness by one of the websites --- modules/changes/changes.js | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) (limited to 'modules') diff --git a/modules/changes/changes.js b/modules/changes/changes.js index 3c75671..d4c48e2 100644 --- a/modules/changes/changes.js +++ b/modules/changes/changes.js @@ -143,21 +143,30 @@ function refreshURLs(cb){ fetch("GET",url,function(url,status,body){ nwaiting--; console.log("Got <"+url+">; status = "+status); + var dosave=true; if(status==-1){ hashes[url]=[new Date(),null,null]; } else { var hash=crypto.createHash("sha256"); hash.update(body); - hashes[url]=[new Date(),hash.digest("hex"),body]; + var res=hash.digest("hex"); + hashes[url]=[new Date(),res,body]; + if(url=="http://www.rolandvdv.nl/M17/"&& + res=="6c09a3f77e8a1ce36ffdf1bf0cff8aa9bb5c17616ba8f31db31d8b5946245362"){ + console.log("ROLAND IS WEER BEZIG"); + dosave=false; + } } - if(!urls[url]){ - console.log("WARNING: url <"+url+"> from hashes not found in urls!"); - } else { - //var last=urls[url].timeline[urls[url].timeline.length-1]; - //if(last==undefined||hashes[url][1]==null||hashes[url][1]!=last[1]){ - urls[url].timeline.push(hashes[url]); - //} + if(dosave){ + if(!urls[url]){ + console.log("WARNING: url <"+url+"> from hashes not found in urls!"); + } else { + //var last=urls[url].timeline[urls[url].timeline.length-1]; + //if(last==undefined||hashes[url][1]==null||hashes[url][1]!=last[1]){ + urls[url].timeline.push(hashes[url]); + //} + } } if(nwaiting==0&&cb)process.nextTick(cb); -- cgit v1.2.3-70-g09d2