summaryrefslogtreecommitdiff
path: root/modules/changes
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2017-10-06 17:32:47 +0200
committertomsmeding <tom.smeding@gmail.com>2017-10-06 17:32:47 +0200
commit8bed4192558aa91cd8fe1ba501200b1c111e43e9 (patch)
tree37616ba3767975e7dcd93be7bd7772ade7181a4b /modules/changes
parentb3e906437937c463244880e3c374e38f9b60a19c (diff)
Fix madness by one of the websites
Diffstat (limited to 'modules/changes')
-rw-r--r--modules/changes/changes.js25
1 files changed, 17 insertions, 8 deletions
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);