Astroport.ONE/tools/Connect_PLAYER_To_Gchange.sh

326 lines
18 KiB
Bash
Raw Normal View History

2022-06-01 16:17:20 +02:00
#!/bin/bash
2022-08-15 19:07:39 +02:00
# Run After PLAYER.entrance.sh
2022-08-23 16:31:40 +02:00
################################################################################
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
2022-12-29 14:51:05 +01:00
. "$MY_PATH/my.sh"
2022-12-10 20:07:32 +01:00
export PLAYERFEEDS=""
2022-11-05 22:32:28 +01:00
2022-06-01 16:17:20 +02:00
######################################################################### CONNECT PLAYER WITH GCHANGE
# Check who is .current PLAYER
PLAYER="$1"
2022-11-05 22:32:28 +01:00
[[ ${PLAYER} == "" ]] && PLAYER=$(cat ~/.zen/game/players/.current/.player 2>/dev/null)
[[ ${PLAYER} == "" ]] && echo "ERROR PLAYER - EXIT" && exit 1
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
[[ $G1PUB == "" ]] && G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
[[ $G1PUB == "" ]] && echo "ERROR G1PUB - EXIT" && exit 1
2022-06-01 16:17:20 +02:00
2022-11-05 22:32:28 +01:00
PSEUDO=$(cat ~/.zen/game/players/${PLAYER}/.pseudo 2>/dev/null)
G1PUB=$(cat ~/.zen/game/players/${PLAYER}/.g1pub 2>/dev/null)
ASTRONS=$(cat ~/.zen/game/players/${PLAYER}/.playerns 2>/dev/null)
## REFRESH ASTRONAUTE TW
2022-12-25 22:26:34 +01:00
ASTRONAUTENS=$(ipfs key list -l | grep -w ${PLAYER} | cut -d ' ' -f1)
[[ ! $ASTRONAUTENS ]] && echo "WARNING No ${PLAYER} in keystore -- EXIT" && exit 1
2022-11-11 18:22:35 +01:00
[[ ! -f ~/.zen/game/players/${PLAYER}/QR.png ]] && echo "NOT MY ${PLAYER} -- EXIT" && exit 1
2022-11-05 22:32:28 +01:00
mkdir -p ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/
2022-08-15 19:07:39 +02:00
## VERIFY IT HAS ALREADY RUN
if [[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/cesium.json ]]; then
2022-11-16 18:53:07 +01:00
## GET GCHANGE PROFIL
2023-01-16 15:16:25 +01:00
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
curl -s ${myGCHANGE}/user/profile/${G1PUB} > ~/.zen/game/players/${PLAYER}/ipfs/gchange.json
# $MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey get > ~/.zen/game/players/${PLAYER}/ipfs/gchange.json
## GET AVATAR PICTURE
cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '._source.avatar._content' | base64 -d > "$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.gchange_avatar.png" 2>/dev/null
2022-11-16 18:53:07 +01:00
2023-01-16 19:12:10 +01:00
## GET CESIUM PUBKEY & C+ PROFILE
CPUB=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '._source.pubkey' 2>/dev/null)
if [[ $CPUB ]]; then
echo "GET CPUB+ PROFILE .... $CPUB"
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
curl -s https://g1.data.e-is.pro get/user/profile/${CPUB} > ~/.zen/game/players/${PLAYER}/ipfs/cesium.json 2>/dev/null
cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '._source.avatar._content' | base64 -d > "$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.cesium_avatar.png" 2>/dev/null
CPSEUDO=$(cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '.title' 2>/dev/null)
[[ $CPSEUDO ]] \
&& echo "♥PARTNER $CPSEUDO" \
&& echo "$CPUB" > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/G1CPUB ## OHHH IT IS REGULAR KEY.
else
echo "NO MASTER CESIUM LINK ... TRY TO GET WALLET PROFILE .... "
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
curl -s https://g1.data.e-is.pro get/user/profile/${G1PUB} > ~/.zen/game/players/${PLAYER}/ipfs/cesium.json 2>/dev/null
cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '._source.avatar._content' | base64 -d > "$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.cesium_avatar.png" 2>/dev/null
CPSEUDO=$(cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '.title' 2>/dev/null)
[[ $CPSEUDO ]] \
&& echo "Ğ1 WALLET " \
&& echo "$G1PUB" > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/G1WALLET ## OHHH IS IT A MEMBER KEY ???
2022-11-16 18:53:07 +01:00
2023-01-16 19:12:10 +01:00
fi
2022-11-16 18:53:07 +01:00
2023-01-16 19:12:10 +01:00
echo ">> GCESIUM LINKS - $CPSEUDO - $G1PUB ($CPUB) <<"
2022-11-16 18:53:07 +01:00
2023-01-16 19:12:10 +01:00
## KEEPING ALREADY EXISTING PROFILE DATA
GPSEUDO=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '.title' 2>/dev/null)
[[ ! $GPSEUDO || $GPSEUDO == "null" ]] && GPSEUDO="$PSEUDO"
CPSEUDO=$(cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '.title' 2>/dev/null)
[[ ! $CPSEUDO || $CPSEUDO == "null" ]] && CPSEUDO="$PLAYER"
GDESCR=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '.description' 2>/dev/null)
[[ ! $GDESCR || $GDESCR == "null" ]] && GDESCR="Astronaute GChange"
CDESCR=$(cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '.description' 2>/dev/null)
[[ ! $CDESCR || $CDESCR == "null" ]] && CDESCR="Portefeuille PalPay"
GVILLE=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '.city' 2>/dev/null)
[[ ! $GVILLE || $GVILLE == "null" ]] && GVILLE=""
CVILLE=$(cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '.description' 2>/dev/null)
[[ ! $CVILLE || $CVILLE == "null" ]] && CVILLE=""
GADRESSE=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '.address' 2>/dev/null)
[[ ! $GADRESSE || $GADRESSE == "null" ]] && GADRESSE=""
CADRESSE=$(cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json | jq -r '.address' 2>/dev/null)
[[ ! $CADRESSE || $CADRESSE == "null" ]] && CADRESSE=""
2022-11-16 06:17:54 +01:00
# POSITION=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '.geoPoint')
2022-12-09 01:39:47 +01:00
# SITE=$(cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json | jq -r '.socials' 2>/dev/null)
2022-11-15 18:57:16 +01:00
2023-01-16 15:16:25 +01:00
## MIX GCHANGE IMAGE AVATAR WITH G1PUB QRCODE
if [[ $(which amzqr) ]]; then
2023-01-16 19:12:10 +01:00
[[ -s "$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.gchange_avatar.png" ]] \
&& IMG="$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.gchange_avatar.png"
[[ -s "$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.cesium_avatar.png" ]] \
&& IMG="$HOME/.zen/game/players/${PLAYER}/ipfs/G1SSB/_g1.cesium_avatar.png"
2023-01-16 15:16:25 +01:00
|| IMG="$HOME/.zen/Astroport.ONE/logo.png"
2023-01-16 19:12:10 +01:00
# QRG1avatar.png
2023-01-16 15:16:25 +01:00
amzqr ${G1PUB} -l H -p "$IMG" -c -n QRG1avatar.png -d ~/.zen/game/players/${PLAYER}/
2023-01-16 19:12:10 +01:00
# QRTWavatar.png
2023-01-16 15:16:25 +01:00
amzqr ${myIPFS}/ipns/$ASTRONAUTENS -l H -p "$IMG" -c -n QRTWavatar.png -d ~/.zen/game/players/${PLAYER}/
else
cp ~/.zen/game/players/${PLAYER}/QR.ASTRONAUTENS.png ~/.zen/game/players/${PLAYER}/QRTWavatar.png
cp ~/.zen/game/players/${PLAYER}/QR.png ~/.zen/game/players/${PLAYER}/QRG1avatar.png
fi
2022-10-07 00:32:33 +02:00
########################################################################
2023-01-16 19:12:10 +01:00
# echo "set -n "${GPSEUDO}" -d "${GDESCR}" -v "${GVILLE}" -a "${GADRESSE}""
2022-10-07 00:32:33 +02:00
########################################################################
2023-01-16 19:12:10 +01:00
if [[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/G1WALLET ]]; then
echo "CREATING GCHANGE+ PROFILE https://gchange.fr"
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey set -n "${GPSEUDO}" -d "${GDESCR}" -v "${GVILLE}" -a "${GADRESSE}" -s "$LIBRA/ipns/$ASTRONAUTENS" -A ~/.zen/game/players/${PLAYER}/QRG1avatar.png #GCHANGE+
[[ ! $? == 0 ]] && echo "GCHANGE PROFILE CREATION FAILED" \
|| cat ~/.zen/game/players/${PLAYER}/ipfs/gchange.json > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/gchange.1st.json
echo " CREATING CESIUM+ https://demo.cesium.app/#/app/wot/lg?q=$G1PUB"
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n "https://g1.data.e-is.pro" set -n "${CPSEUDO}" -d "${CDESCR}" -v "${CVILLE}" -a "${CADRESSE}" --s "http://ipfs.localhost:8080/ipns/$ASTRONAUTENS" -A ~/.zen/game/players/${PLAYER}/QRTWavatar.png #CESIUM+
[[ ! $? == 0 ]] && echo "CESIUM PROFILE CREATION FAILED" \
|| cat ~/.zen/game/players/${PLAYER}/ipfs/cesium.json > ~/.zen/game/players/${PLAYER}/ipfs/G1SSB/cesium.1st.json
fi
2022-10-07 00:32:33 +02:00
fi
2022-08-28 19:09:06 +02:00
2023-01-16 19:12:10 +01:00
## GET LAST ONLINE gchange & cesium PROFILE
2023-01-16 15:16:25 +01:00
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey get > ~/.zen/game/players/${PLAYER}/ipfs/gchange.json
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n "https://g1.data.e-is.pro" get > ~/.zen/game/players/${PLAYER}/ipfs/cesium.json
2022-12-08 23:19:09 +01:00
2022-06-01 16:17:20 +02:00
########################################################################
2022-12-11 18:51:48 +01:00
echo "### ${PLAYER} #################"
echo "SCANNING - $G1PUB STAR FRIENDS"
2022-11-02 18:51:55 +01:00
echo "########################################################################"
2022-09-27 00:09:24 +02:00
################## CHECKING WHO GAVE ME STARS
################## BOOTSTRAP LIKES THEM BACK
################## SEND ipfstryme MESSAGES to FRIENDS
2022-11-05 22:32:28 +01:00
rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/my_star_level
2022-09-27 00:09:24 +02:00
## Getting Gchange liking_me list
2022-12-08 23:19:09 +01:00
echo "Checking received stars"
################################## JAKLIS PLAYER stars
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
2022-12-30 22:55:10 +01:00
~/.zen/Astroport.ONE/tools/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey -n "$myDATA" stars > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json
2023-01-10 17:53:33 +01:00
[[ ! $(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json | jq -r '.likes[].issuer') ]] && echo "Activez votre Toile de Confiance Ŋ1" && exit 0
2022-12-08 23:19:09 +01:00
2022-11-27 18:07:02 +01:00
cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json | jq -r '.likes[].issuer' | sort | uniq > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/liking_me
2022-12-08 23:19:09 +01:00
# echo "cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/received_stars.json | jq -r" # DEBUG
2022-09-27 00:09:24 +02:00
2022-11-05 22:32:28 +01:00
for liking_me in $(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/liking_me | sort | uniq);
2022-09-27 00:09:24 +02:00
do
[[ "${liking_me}" == "" ]] && continue ## Protect from empty line !!
2022-10-24 16:38:59 +02:00
echo "........................."
FRIENDNS=$(~/.zen/Astroport.ONE/tools/g1_to_ipfs.py ${liking_me})
2022-11-02 18:51:55 +01:00
echo "==========================="
echo "${liking_me} IS LIKING ME"
2022-12-29 14:51:05 +01:00
echo "TW ? $LIBRA/ipns/$FRIENDNS "
2022-09-27 00:09:24 +02:00
2022-10-07 00:32:33 +02:00
##### CHECKING IF WE LIKE EACH OTHER Ŋ1 LEVEL
2022-11-27 13:59:03 +01:00
echo "Receiving Stars : cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json | jq -r"
################################## JAKLIS LIKING_ME stars
~/.zen/Astroport.ONE/tools/timeout.sh -t 20 \
~/.zen/Astroport.ONE/tools/jaklis/jaklis.py \
2022-11-05 22:32:28 +01:00
-k ~/.zen/game/players/${PLAYER}/secret.dunikey \
stars -p ${liking_me} > ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json
2022-12-15 21:06:01 +01:00
## ZOMBIE PROTECTION - PURGE AFTER 60 DAYS
find ~/.zen/game/players/${PLAYER}/FRIENDS/*.try -mtime +60 -type f -exec rm -f '{}' \;
try=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}.try 2>/dev/null)
[[ $try > 3 ]] && echo "${liking_me} TOO MANY TRY" && continue
2022-09-27 00:09:24 +02:00
2022-10-06 21:18:54 +02:00
#### RECUP ANNONCES Gchange
## https://www.gchange.fr/#/app/records/wallet?q=2geH4d2sndR47XWtfDWsfLLDVyNNnRsnUD3b1sk9zYc4&old
2022-10-07 17:09:07 +02:00
## https://www.gchange.fr/#/app/market/records/42LqLa7ARTZqUKGz2Msmk79gwsY8ZSoFyMyPyEnoaDXR
2022-10-06 21:18:54 +02:00
2022-11-05 22:32:28 +01:00
## DATA EXTRACTION FROM ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json
my_star_level=$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json | jq -r '.yours.level');
gscore=$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json | jq -r '.score');
myfriendship=$(cat ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json | jq -r '.likes[] | select(.issuer | strings | test("'$G1PUB'"))')
## OH MY FRIEND !
if [[ "$my_star_level" != "null" && "${liking_me}" != "$G1PUB" ]]
2022-09-27 00:09:24 +02:00
then
# ADD ${liking_me} TO MY ipfs FRIENDS list
2022-11-02 18:51:55 +01:00
echo "LIKING with $my_star_level stars : Friend Ŋ1 SCORE $gscore "
2022-11-05 22:32:28 +01:00
mkdir -p ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}
2022-10-24 16:38:59 +02:00
2022-11-05 22:32:28 +01:00
cp ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/ && rm -f ~/.zen/tmp/${IPFSNODEID}/${PLAYER}/${liking_me}.Gstars.json
echo "$my_star_level" > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/stars.level && echo "***** $my_star_level STARS *****"
2022-09-27 00:09:24 +02:00
2022-11-27 13:59:03 +01:00
## GET FRIEND GCHANGE PROFILE
2023-01-10 17:53:33 +01:00
echo "GET FRIEND gchange.json"
2022-11-27 13:59:03 +01:00
${MY_PATH}/timeout.sh -t 20 \
2022-11-27 21:54:40 +01:00
${MY_PATH}/jaklis/jaklis.py get \
2022-11-27 13:59:03 +01:00
-p ${liking_me} > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/gchange.json
FRIENDTITLE=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/gchange.json | jq -r '.title')
## GET FRIEND TW !!
2023-01-10 17:53:33 +01:00
echo "SEARCHING $FRIENDTITLE - ONLINE TW -"
2022-11-16 06:11:07 +01:00
YOU=$(ipfs swarm peers >/dev/null 2>&1 && echo "$USER" || ps auxf --sort=+utime | grep -w ipfs | grep -v -E 'color=auto|grep' | tail -n 1 | cut -d " " -f 1);
LIBRA=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 2)
2022-12-14 17:34:55 +01:00
# DISPLAY TIMER
2023-01-10 17:53:33 +01:00
# ${MY_PATH}/displaytimer.sh 60 &
2022-12-14 17:34:55 +01:00
2023-01-10 17:53:33 +01:00
[[ $YOU ]] \
&& echo "ipfs --timeout 120s cat /ipns/$FRIENDNS > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html" \
&& ipfs --timeout 120s cat /ipns/$FRIENDNS > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html
[[ ! -s ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html ]] \
&& echo "curl -m 120 -so ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html $LIBRA/ipns/$FRIENDNS" \
&& curl -m 120 -so ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html "$LIBRA/ipns/$FRIENDNS"
2022-11-02 18:51:55 +01:00
## PLAYER TW EXISTING ?
2022-11-05 22:32:28 +01:00
if [ ! -s ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html ]; then
2022-11-02 18:51:55 +01:00
## AUCUN VISA ASTRONAUTE ENVOYER UN MESSAGE PAR GCHANGE
2022-12-09 02:08:22 +01:00
echo "AUCUN TW ACTIF. PREVENONS LE"
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey send -d "${liking_me}" -t "HEY BRO !" -m "G1 ♥BOX : https://ipfs.copylaradio.com/ipns/$ASTRONAUTENS"
2022-11-02 18:51:55 +01:00
2022-12-15 21:06:01 +01:00
## I TRY
try=$((try+1)) && echo $try > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}.try
else
2022-11-02 18:51:55 +01:00
2023-01-11 00:04:28 +01:00
FTW="$HOME/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/index.html"
2022-12-15 21:06:01 +01:00
echo "COOL MON AMI PUBLIE SUR IPFS : $FTW"
2023-01-10 17:53:33 +01:00
# LOG
2023-01-11 00:04:28 +01:00
# echo tiddlywiki --load ${FTW} --output ~/.zen/tmp --render '.' "${liking_me}.MadeInZion.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
2022-12-15 21:06:01 +01:00
tiddlywiki --load ${FTW} --output ~/.zen/tmp --render '.' "${liking_me}.MadeInZion.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${liking_me}.MadeInZion.json ]] && echo "~~~ BROKEN $FTW (☓‿‿☓) BAD ~/.zen/tmp/${liking_me}.MadeInZion.json ~~~" && continue
FPLAYER=$(cat ~/.zen/tmp/${liking_me}.MadeInZion.json | jq -r .[].player)
[[ ! $FPLAYER ]] && echo "NO PLAYER = BAD MadeInZion Tiddler" && continue
## CREATING 30 DAYS RSS STREAM
tiddlywiki --load ${FTW} \
2022-12-04 15:12:18 +01:00
--output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${FPLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]]'
2022-12-15 21:06:01 +01:00
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ]] && echo "NO ${FPLAYER} RSS - BAD ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json -" && continue
2022-12-15 21:06:01 +01:00
echo "DEBUG RSS : cat ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json | jq -r"
echo
2022-12-11 04:40:50 +01:00
tiddlywiki --load ${FTW} \
--output ~/.zen/game/players/${PLAYER}/ipfs --render '.' "${FPLAYER}.lightbeam-key.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '$:/plugins/astroport/lightbeams/saver/ipns/lightbeam-key'
[[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.lightbeam-key.json ]] && echo "NO ${FPLAYER} lightbeam-key - CONTINUE -" && continue
ASTRONAUTEFEED=$(cat ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.lightbeam-key.json | jq -r .[].text)
2022-12-15 21:06:01 +01:00
echo "DEBUG LIGHTBEAM : cat ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.lightbeam-key.json | jq -r"
echo
## ADD THIS FPLAYER RSS FEED INTO PLAYER TW
## PUSH DATA TO 12345 SWARM KEY
mkdir -p ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}
cp -f ~/.zen/game/players/${PLAYER}/ipfs/${FPLAYER}.rss.json ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/${FPLAYER}.rss.json
2022-12-14 00:24:14 +01:00
export FRIENDSFEEDS="$ASTRONAUTEFEED\n$FRIENDSFEEDS"
2022-12-14 17:34:55 +01:00
echo "$FRIENDSFEEDS" > ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/FRIENDSFEEDS
2022-12-14 00:24:14 +01:00
2022-12-15 21:06:01 +01:00
echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) : FRIENDSFEEDS=" $FRIENDSFEEDS
2022-12-14 00:24:14 +01:00
2023-01-12 23:42:03 +01:00
export IFRIENDHEAD="<a target='you' href='/ipns/"$FRIENDNS"'>$FRIENDTITLE</a> $IFRIENDHEAD"
2022-12-14 17:34:55 +01:00
echo "$IFRIENDHEAD" > ~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/IFRIENDHEAD
2022-12-14 00:24:14 +01:00
2022-12-15 21:06:01 +01:00
echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) : IFRIENDHEAD=" $IFRIENDHEAD
2022-12-14 00:24:14 +01:00
echo "APP=RSS : PLAYER FPLAYER RSS PUBLICATION READY"
echo "~/.zen/tmp/${IPFSNODEID}/rss/${PLAYER}/${FPLAYER}.rss.json"
fi
2022-11-02 18:51:55 +01:00
## ACTIVER RECUP ANNONCES...
2022-12-15 21:06:01 +01:00
# SCRAPING DONNE LE BON COIN - DIFFICILE - UTILISER COOKIE NAVIGATEUR
# https://www.leboncoin.fr/recherche?text=donne&locations=Toulouse__43.59743304757555_1.4471155185604894_10000_5000&owner_type=private&sort=time&donation=1
2022-10-07 00:32:33 +02:00
## Get Ŋ2 LEVEL
2022-11-05 22:32:28 +01:00
echo "(°▃▃°) (°▃▃°) (°▃▃°) Ŋ2 scraping ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/friend_of_friend.json"
for nid in $(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/${liking_me}.Gstars.json | jq -r '.likes[].issuer');
2022-10-07 00:32:33 +02:00
do
2022-11-27 13:59:03 +01:00
2022-10-07 00:32:33 +02:00
echo "Ami(s) de cet Ami $linking_me : $nid"
2022-11-05 22:32:28 +01:00
friend_of_friend=$(cat ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/${liking_me}.Gstars.json | jq -r '.likes[] | select(.issuer | strings | test("'$nid'"))')
2022-11-27 13:59:03 +01:00
echo "$friend_of_friend" | jq -r > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}/FoF_$nid.json
2022-10-07 00:32:33 +02:00
done
else
2022-12-15 21:06:01 +01:00
#########################################
## COOL FEATURE FOR GCHANGE ACCOUNT CONFIDENCE
## IS IT REALLY A FRIEND I LIKE ?
2022-12-09 02:08:22 +01:00
echo "BRO?"
2022-12-30 22:55:10 +01:00
$MY_PATH/jaklis/jaklis.py -k ~/.zen/game/players/${PLAYER}/secret.dunikey send -d "${G1PUB}" -t "Bro ?" -m "$myGCHANGE/#/app/user/${liking_me}/"
try=$((try+1)) && echo $try > ~/.zen/game/players/${PLAYER}/FRIENDS/${liking_me}.try
2022-09-27 00:09:24 +02:00
2022-11-02 18:51:55 +01:00
fi
2022-09-27 00:09:24 +02:00
sleep $((1 + RANDOM % 2)) # SLOW DOWN
2022-11-02 18:51:55 +01:00
2022-09-27 00:09:24 +02:00
done
2022-06-01 16:17:20 +02:00
2022-08-18 03:47:49 +02:00
exit 0