From 0ea7169bacbe8c533f6bd359ea96df85fa3c5459 Mon Sep 17 00:00:00 2001 From: fred Date: Sat, 2 Mar 2024 09:55:51 +0100 Subject: [PATCH] compare INSIDE.json and NEW.json --- RUNTIME/PLAYER.refresh.sh | 6 ++++++ RUNTIME/RSS2UPlanetSECTORTW.sh | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index cb4f322c..ce3f10ac 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -31,6 +31,7 @@ for PLAYER in ${PLAYERONE[@]}; do [[ ! -d ~/.zen/game/players/${PLAYER:-undefined} ]] && echo "BAD ${PLAYERONE}" && continue [[ ! $(echo "${PLAYER}" | grep '@') ]] && continue + start=`date +%s` # CLEAN LOST ACCOUNT [[ ! -s ~/.zen/game/players/${PLAYER}/secret.dunikey ]] \ && rm -Rf ~/.zen/game/players/${PLAYER} \ @@ -418,6 +419,11 @@ for PLAYER in ${PLAYERONE[@]}; do rm -Rf ~/.zen/tmp/${MOATS} echo + end=`date +%s` + dur=`expr $end - $start` + echo "${PLAYER} refreshing took $dur seconds (${MOATS})" + + done echo "============================================ PLAYER.refresh DONE." diff --git a/RUNTIME/RSS2UPlanetSECTORTW.sh b/RUNTIME/RSS2UPlanetSECTORTW.sh index 3feac280..92c99378 100755 --- a/RUNTIME/RSS2UPlanetSECTORTW.sh +++ b/RUNTIME/RSS2UPlanetSECTORTW.sh @@ -89,10 +89,10 @@ while read title; do ## SAME TIDDLER echo "TIDDLER WITH TITLE $title and more than 1 signature ALREADY EXISTS..." - cat ~/.zen/tmp/${MOATS}/TMP.json | jq .[] > ~/.zen/tmp/${MOATS}/INSIDE.json + cat ~/.zen/tmp/${MOATS}/TMP.json | jq -rc .[] > ~/.zen/tmp/${MOATS}/INSIDE.json cat "${RSS}" | jq -rc ".[] | select(.title == \"$title\")" > ~/.zen/tmp/${MOATS}/NEW.json - if [[ ! $(diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json) ]]; then + if [[ $(diff ~/.zen/tmp/${MOATS}/NEW.json ~/.zen/tmp/${MOATS}/INSIDE.json) == "" ]]; then echo "... Tiddlers are similar ..." ((floop++)) continue