From 264fc9de32ee37ad4d4df422126a47a639447029 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 12 Oct 2022 00:44:24 +0200 Subject: [PATCH] better --- ASTROBOT/G1CopierYoutube.sh | 20 ++++---------------- ASTROBOT/PLAYER.refresh.sh | 1 + ASTROBOT/VOEUX.create.sh | 4 +++- ASTROBOT/VOEUX.refresh.sh | 1 + 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/ASTROBOT/G1CopierYoutube.sh b/ASTROBOT/G1CopierYoutube.sh index da27d8c7..e8dde906 100755 --- a/ASTROBOT/G1CopierYoutube.sh +++ b/ASTROBOT/G1CopierYoutube.sh @@ -6,6 +6,7 @@ MY_PATH="`dirname \"$0\"`" # relative MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized ME="${0##*/}" +echo "-----" echo "$ME RUNNING" # Need TW index.html path + IPNS publication Key (available in IPFS keystore) # Search for "tube" tagged tiddlers to get URL @@ -37,7 +38,6 @@ tiddlywiki --load ${INDEX} \ --output ~/.zen/tmp/$WISHKEY \ --render '.' 'CopierYoutube.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[CopierYoutube]]' -[[ ! -s ~/.zen/tmp/$WISHKEY/CopierYoutube.json ]] && echo "NO TUBE" && exit 0 ################################################################### ## TEXT TREATMENT ## For this TAG, specific extract URL from text field and copy all video from links into tid.json @@ -50,6 +50,8 @@ for YURL in $(cat ~/.zen/tmp/$WISHKEY/CopierYoutube.json | jq -r '.[].text' | gr done # FINISH YURL loop +################################################################### +[[ ! -s ~/.zen/tmp/$WISHKEY/ytids.$MOATS ]] && echo "AUCUN YOUTUBEID pour CopierYoutube" && exit 0 ################################################################### ################################################################### @@ -58,7 +60,6 @@ done # FINISH YURL loop while read YID; do - [[ -f ~/.zen/tmp/$WISHKEY/$YID.TW.json ]] && echo "Tiddler json already existing : ~/.zen/tmp/$WISHKEY/$YID.TW.json" && continue # SINGLE VIDEO YURL @@ -157,17 +158,4 @@ while read YID; fi done < ~/.zen/tmp/$WISHKEY/ytids.$MOATS # FINISH YID loop 1 - -## FINAL TW IPNS PUBLISHING -echo "ipfs name publish -k $WISHKEY ($INDEX)" -ILINK=$(ipfs add -q $INDEX | tail -n 1) -echo "/ipfs/$ILINK" -ipfs name publish -k $WISHKEY /ipfs/$ILINK - -myIP=$(hostname -I | awk '{print $1}' | head -n 1) - -echo "==========================" -echo "Nouveau TW" -echo "http://$myIP:8080/ipns/$TWNS" -# Removing tag=tube -# --deletetiddlers '[tag[tube]]' +exit 0 diff --git a/ASTROBOT/PLAYER.refresh.sh b/ASTROBOT/PLAYER.refresh.sh index e223afd8..8a727b8b 100755 --- a/ASTROBOT/PLAYER.refresh.sh +++ b/ASTROBOT/PLAYER.refresh.sh @@ -30,6 +30,7 @@ for PLAYER in $(ls ~/.zen/game/players/); do # Get PLAYER wallet amount BAL=$($MY_PATH/../tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey balance) echo "+++ WALLET BALANCE _ $BAL (G1) _" + echo myIP=$(hostname -I | awk '{print $1}' | head -n 1) diff --git a/ASTROBOT/VOEUX.create.sh b/ASTROBOT/VOEUX.create.sh index b54d4df7..9dbef6a6 100755 --- a/ASTROBOT/VOEUX.create.sh +++ b/ASTROBOT/VOEUX.create.sh @@ -19,10 +19,12 @@ PLAYER="$2" ## IPNS KEY NAME - G1PUB - PLAYER ... [[ ! $PLAYER ]] && echo "Please provide IPFS publish key" && exit 1 ASTRONAUTENS=$(ipfs key list -l | grep -w $PLAYER | cut -d ' ' -f1) +[[ ! $ASTRONAUTENS ]] && echo "$PLAYER IPNS INTROUVABLE" && exit 1 + myIP=$(hostname -I | awk '{print $1}' | head -n 1) ## EXPORT [tag[voeu]] -echo '## EXPORT FROM $PLAYER TW "[tag[voeu]]"' +echo "## EXPORT FROM $PLAYER TW [tag[voeu]] $INDEX" rm -f ~/.zen/tmp/voeu.json tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' 'voeu.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[voeu]]' diff --git a/ASTROBOT/VOEUX.refresh.sh b/ASTROBOT/VOEUX.refresh.sh index 07ee281e..41be0876 100755 --- a/ASTROBOT/VOEUX.refresh.sh +++ b/ASTROBOT/VOEUX.refresh.sh @@ -19,6 +19,7 @@ for v in $(cat ~/.zen/game/players/*/VOEUx/*/.title); do echo $v ;done for VOEU in $(ls ~/.zen/game/world/); do + [[ ! -d ~/.zen/game/world/$VOEU ]] && echo "BAD $VOEU - CONTINUE -" && continue ## CLEAN OLD CACHE rm -Rf ~/.zen/tmp/work mkdir -p ~/.zen/tmp/work