From e9eafd8d57864ae7b501b0ff1b3228d21be8f3be Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 6 Oct 2022 21:18:54 +0200 Subject: [PATCH] act better --- 12345.sh | 2 +- ASTROBOT/GCHANGE.process.sh | 2 ++ tools/Connect_PLAYER_To_Gchange.sh | 15 ++++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/12345.sh b/12345.sh index da5aecf5..378dcc70 100755 --- a/12345.sh +++ b/12345.sh @@ -25,7 +25,7 @@ myIP=$(hostname -I | awk '{print $1}' | head -n 1) # Check if Astroport Station already has a "captain" echo "Connect Astronaut with $myIP" -xdg-open "file://$HOME/.zen/Astroport.ONE/templates/instascan.html" 2>/dev/null +[[ $DISPLAY ]] && xdg-open "file://$HOME/.zen/Astroport.ONE/templates/instascan.html" 2>/dev/null function urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; } diff --git a/ASTROBOT/GCHANGE.process.sh b/ASTROBOT/GCHANGE.process.sh index 30399aa1..0cc3db88 100755 --- a/ASTROBOT/GCHANGE.process.sh +++ b/ASTROBOT/GCHANGE.process.sh @@ -11,6 +11,8 @@ # https://web.archive.org/web/20210621185958/http://www.elasticsearchtutorial.com/spatial-search-tutorial.html # Create tiddler informing ... TODO Add keyword ... Use tag="annonce" for tiddlers propagation +# DOC : http://doc.e-is.pro/cesium-plus-pod/REST_API.html#overview + echo "TODO DEBUG. CONTINUE?" read diff --git a/tools/Connect_PLAYER_To_Gchange.sh b/tools/Connect_PLAYER_To_Gchange.sh index 7c91c523..abb8922c 100755 --- a/tools/Connect_PLAYER_To_Gchange.sh +++ b/tools/Connect_PLAYER_To_Gchange.sh @@ -16,12 +16,12 @@ ASTRONAUTENS=$(ipfs key list -l | grep -w "$PLAYER" | cut -d ' ' -f 1) echo "CREATING $PLAYER GCHANGE+ PROFILE" ######################################################################## $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" set --name "Astronaute $PSEUDO" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "https://astroport.com/ipns/$ASTRONAUTENS" #GCHANGE+ -[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && echo "Action Manuelle " $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" set --name "Astronaute $PSEUDO" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "https://astroport.com/ipns/$ASTRONAUTENS" #GCHANGE+ +[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" && echo "Action Manuelle " $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" set --name "Astronaute $PSEUDO" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "https://tube.copylaradio.com/ipns/$ASTRONAUTENS" #GCHANGE+ ######################################################################## #echo "CREATING $PLAYER CESIUM+ PROFILE" ######################################################################## -$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://g1.data.presles.fr" set --name "Astronaute $PLAYER" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #CESIUM+ +$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://g1.data.presles.fr" set --name "Astronaute $PSEUDO" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #CESIUM+ [[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" && echo "Action Manuelle " $ $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://g1.data.presles.fr" set --name "Astronaute $PLAYER" --avatar "/home/$USER/.zen/Astroport.ONE/images/logo.png" --site "http://127.0.0.1:8080/ipns/$ASTRONAUTENS" #CESIUM+ ######################################################################## @@ -34,24 +34,25 @@ echo "SCANNING MY GCHANGE FRIENDS" ################## SEND ipfstryme MESSAGES to FRIENDS rm -f ~/.zen/tmp/friend_of_mine ## Getting Gchange liking_me list +echo "Reading incoming stars" ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 ~/.zen/Astroport.ONE/tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" stars | jq -r '.likes[].issuer' | uniq > ~/.zen/tmp/liking_me -## Adding RANDOM bootstrap to liking_me list -~/.zen/Astroport.ONE/tools/ipfs_to_g1.py $(cat ~/.zen/astrXbian/A_boostrap_nodes.txt | grep -Ev "#" | rev | cut -d '/' -f 1 | rev | shuf | head -n 1) >> ~/.zen/tmp/liking_me - for liking_me in $(cat ~/.zen/tmp/liking_me | sort | uniq); do [[ "$liking_me" == "" ]] && continue ## Protect from empty line !! ipfsnodeid=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py $liking_me) - echo "Reading stars.level from Stations IPNS Capsules." + echo "Reading stars.level from Astronaut /ipns/$ipfsnodeid TW Capsule" ##### CHECKING IF WE LIKE EACH OTHER (AVOID LIKING MYSELF) ~/.zen/Astroport.ONE/tools/timeout.sh -t 20 ~/.zen/Astroport.ONE/tools/jaklis/jaklis.py -k ~/.zen/game/players/$PLAYER/secret.dunikey -n "https://data.gchange.fr" stars -p $liking_me > ~/.zen/tmp/Gstars.json ## ZOMBIE PROTECTION [[ "$?" == "0" && ! -s ~/.zen/tmp/Gstars.json ]] && rm -Rf ~/.zen/game/players/$PLAYER/FRIENDS/$liking_me && echo "$liking_me is a ZOMBIE..." && continue - friend_of_mine=$(cat ~/.zen/tmp/Gstars.json | jq -r '.yours'); +#### RECUP ANNONCES Gchange +## https://www.gchange.fr/#/app/records/wallet?q=2geH4d2sndR47XWtfDWsfLLDVyNNnRsnUD3b1sk9zYc4&old + + friend_of_mine=$(cat ~/.zen/tmp/Gstars.json | jq -r '.likes[].issuer' | grep -w "$G1PUB" ); if [[ "$friend_of_mine" != "null" && "$liking_me" != "$G1PUB" ]] then # ADD $liking_me TO MY ipfs FRIENDS list