act better

This commit is contained in:
fred 2022-10-06 21:18:54 +02:00
parent 0d8715b531
commit e9eafd8d57
3 changed files with 11 additions and 8 deletions

View File

@ -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}"; }

View File

@ -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

View File

@ -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