From 2397b919064598e2c59dc997cf14add194687b54 Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Tue, 13 Sep 2016 23:14:16 +0200 Subject: Add site body to timeline --- modules/changes/changes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/changes/changes.js b/modules/changes/changes.js index 6a8c8f2..9c536b3 100644 --- a/modules/changes/changes.js +++ b/modules/changes/changes.js @@ -18,7 +18,7 @@ persist.initSync(); //urls: map(url => URLobject) //url: String -//URLobject: {url, timeline: [[Date, hash]]} +//URLobject: {url, timeline: [[Date, hash, contents]]} var urls=persist.getItemSync("urls"); if(!urls){ urls={}; @@ -91,11 +91,11 @@ function refreshURLs(){ fetch("GET",url,function(url,status,body){ console.log("Got <"+url+">; status = "+status); if(status==-1){ - hashes[url]=[new Date(),null]; + hashes[url]=[new Date(),null,null]; } else { var hash=crypto.createHash("sha256"); hash.update(body); - hashes[url]=[new Date(),hash.digest("hex")]; + hashes[url]=[new Date(),hash.digest("hex"),body]; } if(!urls[url]){ -- cgit v1.2.3-70-g09d2