diff --git a/tools/make_image_ipfs_index_carousel.sh b/tools/make_image_ipfs_index_carousel.sh index 7359be3c..473a0546 100755 --- a/tools/make_image_ipfs_index_carousel.sh +++ b/tools/make_image_ipfs_index_carousel.sh @@ -21,21 +21,58 @@ if [[ ! -d $img_dir ]]; then # Get PLAYER wallet amount :: ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/COINS echo "$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey balance" - $MY_PATH/COINScheck.sh $pub > ~/.zen/tmp/$PLAYER.coins - cat ~/.zen/tmp/$PLAYER.coins - COINS=$(cat ~/.zen/tmp/$PLAYER.coins | tail -n 1) + COINS=$($MY_PATH/COINScheck.sh ${pub} | tail -n 1) echo "+++ ${PLAYER} have $COINS Ğ1 Coins +++" ## USE G1BARRE OR G1WorldMap.png AS 1ST IMAGE - curl -m 3 -so ~/.zen/tmp/carousel/${pub}.one.png \ - "https://g1sms.fr/g1barre/image.php?pubkey=${pub}&target=20000&title=${PLAYER}&node=g1.asycn.io&start_date=2020-01-01&display_pubkey=true&display_qrcode=true" - [[ $(file -b ~/.zen/tmp/carousel/${pub}.one.png | cut -d ' ' -f 1) == "PNG" ]] \ - && echo "GOT ~/.zen/tmp/carousel/${pub}.one.png" \ - || cp $MY_PATH/../images/G1WorldMap.png ~/.zen/tmp/carousel/${pub}.one.png + #~ curl -m 3 -so ~/.zen/tmp/carousel/${pub}.one.png \ + #~ "https://g1sms.fr/g1barre/image.php?pubkey=${pub}&target=20000&title=${PLAYER}&node=g1.asycn.io&start_date=2020-01-01&display_pubkey=true&display_qrcode=true" + #~ [[ $(file -b ~/.zen/tmp/carousel/${pub}.one.png | cut -d ' ' -f 1) == "PNG" ]] \ + #~ && echo "GOT ~/.zen/tmp/carousel/${pub}.one.png" \ + #~ || cp $MY_PATH/../images/G1WorldMap.png ~/.zen/tmp/carousel/${pub}.one.png + cp $MY_PATH/../images/G1WorldMap.png ~/.zen/tmp/carousel/${pub}.one.png + + ################## + ## PREPARE LOOP LINK LINE + ASTRONAUTENS=$(cat ~/.zen/game/players/${PLAYER}/.playerns) + [[ $COINS -gt 0 ]] \ + && echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert \ + || echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert + + ## EXTRACT G1Voeu FROM PLAYER TW + echo "Ŋ1Flux ____ " > ~/.zen/tmp/carousel/${pub}.button + INDEX=~/.zen/game/players/${PLAYER}/ipfs/moa/index.html + + if [[ -s ${INDEX} ]]; then + # EXTRACT [tag[moa]] : ~/.zen/game/players/${PLAYER}/moa.jpg + tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' "${PLAYER}.moa.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[moa]]' + cat ~/.zen/tmp/${PLAYER}.moa.json | jq -r '.[].text' | base64 -d > ~/.zen/game/players/${PLAYER}/moa.jpg + echo "DESSIN DE MOA : ~/.zen/game/players/${PLAYER}/moa.jpg" + [[ $(file -b ~/.zen/game/players/${PLAYER}/moa.jpg | cut -d ' ' -f 1) == "JPEG" ]] \ + && convert ~/.zen/game/players/${PLAYER}/moa.jpg -resize 200 ~/.zen/tmp/moa.jpg \ + && composite -compose Over -gravity Center -geometry +0+0 ~/.zen/tmp/moa.jpg ~/.zen/tmp/carousel/${pub}.one.png ~/.zen/tmp/carousel/${pub}.one.png + + ## EXTRACT [tag[G1Voeu]] : ~/.zen/tmp/${PLAYER}.g1wishes.txt + tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' "${PLAYER}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]' + cat ~/.zen/tmp/${PLAYER}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${PLAYER}.g1wishes.txt + while read WISH + do + [[ ${WISH} == "" || ${WISH} == "null" ]] && echo "BLURP. EMPTY WISH" && continue + WISHNAME=$(cat ~/.zen/tmp/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .title') + [[ ! ${WISHNAME} ]] && echo "WISH sans NOM - CONTINUE -" && continue + echo "" >> ~/.zen/tmp/carousel/${pub}.button + done < ~/.zen/tmp/${PLAYER}.g1wishes.txt + fi + echo "" >> ~/.zen/tmp/carousel/${pub}.button +################## + + + # CREATE G1 AMZQR CIMG="$MY_PATH/../images/g1ticket.png" amzqr ${pub} -l H -p "$CIMG" -c -n QRG1avatar.png -d ~/.zen/game/players/${PLAYER}/ convert ~/.zen/game/players/${PLAYER}/QRG1avatar.png -resize 250 ~/.zen/tmp/QR.png + # ADD IT composite -compose Over -gravity NorthEast -geometry +0+0 ~/.zen/tmp/QR.png ~/.zen/tmp/carousel/${pub}.one.png ~/.zen/tmp/one.png ## WRITE ON IT : ASK FOR REFILL @@ -45,29 +82,7 @@ if [[ ! -d $img_dir ]]; then -pointsize 14 -fill white -draw 'text 40, 200 "'"$(date)"'"' \ "${HOME}/.zen/tmp/one.png" "${HOME}/.zen/tmp/carousel/${pub}.png" \ && rm ${HOME}/.zen/tmp/carousel/${pub}.one.png - ################## - ## PREPARE LOOP LINK LINE - ASTRONAUTENS=$(cat ~/.zen/game/players/${PLAYER}/.playerns) - [[ $COINS -gt 0 ]] \ - && echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert \ - || echo "_REPLACE_" > ~/.zen/tmp/carousel/${pub}.insert - ## EXTRACT G1Voeu FROM PLAYER TW - echo "Ŋ1Flux ___ " > ~/.zen/tmp/carousel/${pub}.button - INDEX=~/.zen/game/players/${PLAYER}/ipfs/moa/index.html - if [[ -s ${INDEX} ]]; then - tiddlywiki --load ${INDEX} --output ~/.zen/tmp --render '.' "${PLAYER}.g1voeu.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[tag[G1Voeu]]' - cat ~/.zen/tmp/${PLAYER}.g1voeu.json | jq -r '.[].wish' > ~/.zen/tmp/${PLAYER}.g1wishes.txt - while read WISH - do - [[ ${WISH} == "" || ${WISH} == "null" ]] && echo "BLURP. EMPTY WISH" && continue - WISHNAME=$(cat ~/.zen/tmp/${PLAYER}.g1voeu.json | jq .[] | jq -r 'select(.wish=="'${WISH}'") | .title') - [[ ! ${WISHNAME} ]] && echo "WISH sans NOM - CONTINUE -" && continue - echo "" >> ~/.zen/tmp/carousel/${pub}.button - done < ~/.zen/tmp/${PLAYER}.g1wishes.txt - fi - echo "" >> ~/.zen/tmp/carousel/${pub}.button -################## done img_dir="$HOME/.zen/tmp/carousel" diff --git a/tools/new_file_in_astroport.sh b/tools/new_file_in_astroport.sh index 3357f7b6..d7cd0c03 100755 --- a/tools/new_file_in_astroport.sh +++ b/tools/new_file_in_astroport.sh @@ -47,7 +47,8 @@ file="$2" G1PUB="$3" -### ECHO COMMAND RECEIVED +### ECHO COMMAND RECEIVED : +echo "FOUNIR 'PATH' 'FILE' et 'G1PUB' du PLAYER inscrit sur la STATION" echo "$MY_PATH/new_file_in_astroport.sh PATH/ \"$path\" FILE \"$file\" G1PUB \"$G1PUB\" " ################################################ @@ -137,12 +138,13 @@ case ${type} in exit 1 fi ;; - ## TODO ADD "httrack" for website copying - ## httrack "https://wiki.lowtechlab.org" -O "./wiki.lowtechlab.org" "+*.lowtechlab.org/*" -v -%l "fr" - ## *) - er="$type inconnu" && echo "$er" && exit 1 + INDEXPREFIX=$(echo "$type" | awk '{ print toupper($0) }') + REFERENCE=$(echo "$path" | cut -d '/' -f 7 ) + echo "Media type $INDEXPREFIX REFERENCE : $REFERENCE" + [[ ${INDEXPREFIX} == "" || ${REFERENCE} == "" ]] && echo "Must put file in ~/Astroport/${PLAYER}/${type}/REFERENCE" && exit 1 ;; + esac ### SET MEDIAKEY (PROVIDED IN BATCH FROM AJOUTER MEDIA) diff --git a/www/PasseportTerre/index.html b/www/PasseportTerre/index.html index 6ea7ca8d..1ec8dd17 100644 --- a/www/PasseportTerre/index.html +++ b/www/PasseportTerre/index.html @@ -133,6 +133,7 @@ Link in Le Claude
+

G1_G1VOEU_ _PLAYER_

A Friendly Planet of Friends
@@ -235,8 +236,6 @@




- -

G1_G1VOEU_ _PLAYER_