From 0be315ca46b7536dd8139abcbb49f45c2c1ccacd Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Wed, 13 Jan 2016 22:23:53 +0100 Subject: parse the json --- functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions.sh b/functions.sh index b24f80b..c1ee319 100755 --- a/functions.sh +++ b/functions.sh @@ -111,7 +111,7 @@ function fgetstatenames() { function fgetprogress() { fensurelogin json="$(fcurlwithtoken 'https://www.e-thermostaat.nl/pages/temperature_progress' | grep -m 1 'var json_data =' | sed 's/[^=]*= *\({.*}\);.*/\1/')" - echo $json + echo $json | node -e 's="";process.stdin.on("data",function(d){s+=d.toString();});process.stdin.on("end",function(){o=JSON.parse(s);for(k in o){if(isNaN(+k))continue;for(K in o[k])console.log(("00"+k).slice(-2)+":"+("00"+K).slice(-2)+" "+o[k][K].M+" "+o[k][K].W);}})' } -- cgit v1.2.3-54-g00ecf