Add BunkeBOX Tiddler along with CopierYoutube voeu for next 20H12

This commit is contained in:
fred 2022-12-08 19:34:31 +01:00
parent 8d1de09958
commit e9577844cb
3 changed files with 22 additions and 18 deletions

File diff suppressed because one or more lines are too long

View File

@ -6,60 +6,60 @@ ME="${0##*/}"
ASTRONAUTENS="$1" ASTRONAUTENS="$1"
MOATS="$2" MOATS="$2"
[[ ! $ASTRONAUTENS || ! $MOATS ]] && echo "$(ME) : ASTRONAUTENS & MOATS needed" && exit 1 [[ ! $ASTRONAUTENS || ! $MOATS ]] && echo "${ME} : ASTRONAUTENS & MOATS needed" && exit 1
start=$(date +%s) start=$(date +%s)
IPFSNODEID=$(ipfs id -f='<id>\n') || ( echo "$(ME) : IPFSNODEID MISSING" && exit 1 ) IPFSNODEID=$(ipfs id -f='<id>\n') || ( echo "${ME} : IPFSNODEID MISSING" && exit 1 )
TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3) TUBE=$(head -n 2 ~/.zen/Astroport.ONE/A_boostrap_nodes.txt | tail -n 1 | cut -d ' ' -f 3)
## GETTING LAST TW via IPFS ## GETTING LAST TW via IPFS
echo "$(ME) : IPFS : ipfs --timeout 12s cat /ipns/${ASTRONAUTENS}"\ echo "${ME} : IPFS : ipfs --timeout 12s cat /ipns/${ASTRONAUTENS}"\
&& ipfs --timeout 12s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/coucou/${MOATS}.astroindex.html && ipfs --timeout 12s cat /ipns/${ASTRONAUTENS} > ~/.zen/tmp/coucou/${MOATS}.astroindex.html
## GETTING LAST TW via HTTP ## GETTING LAST TW via HTTP
[[ ! -s ~/.zen/tmp/coucou/${MOATS}.astroindex.html ]] \ [[ ! -s ~/.zen/tmp/coucou/${MOATS}.astroindex.html ]] \
&& echo "$(ME) : WWW : $TUBE/ipns/${ASTRONAUTENS}" \ && echo "${ME} : WWW : $TUBE/ipns/${ASTRONAUTENS}" \
&& curl -m 12 -so ~/.zen/tmp/coucou/${MOATS}.astroindex.html "$TUBE/ipns/${ASTRONAUTENS}" \ && curl -m 12 -so ~/.zen/tmp/coucou/${MOATS}.astroindex.html "$TUBE/ipns/${ASTRONAUTENS}" \
|| curl -m 1 -so ~/.zen/tmp/${MOATS}.html "$TUBE/ipns/${ASTRONAUTENS}" ## Ask caching || curl -m 1 -so ~/.zen/tmp/${MOATS}.html "$TUBE/ipns/${ASTRONAUTENS}" ## Ask caching
### GOT TW !! ### GOT TW !!
if [[ -s ~/.zen/tmp/coucou/${MOATS}.astroindex.html ]]; then if [[ -s ~/.zen/tmp/coucou/${MOATS}.astroindex.html ]]; then
echo "$(ME) : GOT TW !!" echo "${ME} : GOT TW !!"
tiddlywiki --load ~/.zen/tmp/coucou/${MOATS}.astroindex.html --output ~/.zen/tmp --render '.' ${MOATS}'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion' tiddlywiki --load ~/.zen/tmp/coucou/${MOATS}.astroindex.html --output ~/.zen/tmp --render '.' ${MOATS}'MadeInZion.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'MadeInZion'
[[ ! -s ~/.zen/tmp/${MOATS}MadeInZion.json ]] && echo "$(ME) : BAD TW (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1 [[ ! -s ~/.zen/tmp/${MOATS}MadeInZion.json ]] && echo "${ME} : BAD TW (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1
PLAYER=$(cat ~/.zen/tmp/${MOATS}MadeInZion.json | jq -r .[].player) PLAYER=$(cat ~/.zen/tmp/${MOATS}MadeInZion.json | jq -r .[].player)
## EMAIL STYLE ## EMAIL STYLE
if [[ "${PLAYER}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then if [[ "${PLAYER}" =~ ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$ ]]; then
echo "$(ME) : VALID PLAYER (✜‿‿✜) $PLAYER " echo "${ME} : VALID PLAYER (✜‿‿✜) $PLAYER "
tiddlywiki --load ~/.zen/tmp/coucou/${MOATS}.astroindex.html --output ~/.zen/tmp --render '.' ${MOATS}'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport' tiddlywiki --load ~/.zen/tmp/coucou/${MOATS}.astroindex.html --output ~/.zen/tmp --render '.' ${MOATS}'Astroport.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' 'Astroport'
[[ ! -s ~/.zen/tmp/${MOATS}Astroport.json ]] && echo "$(ME) : BAD TW (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1 [[ ! -s ~/.zen/tmp/${MOATS}Astroport.json ]] && echo "${ME} : BAD TW (☓‿‿☓) Execution time was "`expr $(date +%s) - $start` seconds. && exit 1
## EXPORT PLAYER VALUE TO CALLING SCRIPT ## EXPORT PLAYER VALUE TO CALLING SCRIPT
export PLAYER=$PLAYER export PLAYER=$PLAYER
else else
echo "$(ME) : BAD PLAYER" echo "${ME} : BAD PLAYER"
echo "$(ME) : KO ${PLAYER} : (#__#) '" && exit 1 echo "${ME} : KO ${PLAYER} : (#__#) '" && exit 1
fi fi
## IN CACHE ## IN CACHE
echo "$(ME) : CACHING ~/.zen/tmp/$IPFSNODEID/$PLAYER/" echo "${ME} : CACHING ~/.zen/tmp/$IPFSNODEID/$PLAYER/"
mkdir -p ~/.zen/tmp/$IPFSNODEID/$PLAYER/ mkdir -p ~/.zen/tmp/$IPFSNODEID/$PLAYER/
cp -f ~/.zen/tmp/coucou/${MOATS}.astroindex.html ~/.zen/tmp/$IPFSNODEID/$PLAYER/index.html cp -f ~/.zen/tmp/coucou/${MOATS}.astroindex.html ~/.zen/tmp/$IPFSNODEID/$PLAYER/index.html
### NO TW !! ### NO TW !!
else else
echo "$(ME) : (-__-) NOTHING (-__-)" echo "${ME} : (-__-) NOTHING (-__-)"
fi fi
dur=`expr $(date +%s) - $start` dur=`expr $(date +%s) - $start`
[[ $XDG_SESSION_TYPE == 'x11' ]] && espeak "$dur seconds for $(cat ~/.zen/tmp/${MOATS}Astroport.json | jq -r .[].pseudo) TW caching" [[ $XDG_SESSION_TYPE == 'x11' ]] && espeak "$dur seconds for $(cat ~/.zen/tmp/${MOATS}Astroport.json | jq -r .[].pseudo) TW caching"
echo "$(ME) : (0‿‿0) Execution time was $dur seconds." echo "${ME} : (0‿‿0) Execution time was $dur seconds."
exit 0 exit 0

View File

@ -91,7 +91,7 @@ if [[ $SALT != "" && PEPPER != "" ]]; then
fi fi
################################################################################ ################################################################################
TWMODEL="/ipfs/bafybeidxavdjadjyvxf7mdebuniy5vzbma7r7pkceimqdb6zw3mkgupzhm" TWMODEL="/ipfs/bafybeihtuyyjepcdpyqxrrdmsfsk24i6x47i74dkupxpamcnu6ffrqng3y"
##################################################### # NEW PLAYER ############### ##################################################### # NEW PLAYER ###############
################################################################################ ################################################################################
echo "============================================= echo "=============================================
@ -211,7 +211,8 @@ G1PUB=$(cat /tmp/secret.dunikey | grep 'pub:' | cut -d ' ' -f 2)
# La Clef IPNS porte comme nom G1PUB # La Clef IPNS porte comme nom G1PUB
sed -i "s~_MEDIAKEY_~${PLAYER}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html sed -i "s~_MEDIAKEY_~${PLAYER}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${ASTRONAUTENS}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html sed -i "s~k2k4r8kxfnknsdf7tpyc46ks2jb3s9uvd3lqtcv9xlq9rsoem7jajd75~${ASTRONAUTENS}~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html
sed -i "s~ipfs.infura.io~ipfs.copylaradio.com~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # USELESS
sed -i "s~ipfs.infura.io~ipfs.copylaradio.com~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # USELESS ?!
# #
sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or ipfs.localhost) sed -i "s~127.0.0.1~$myIP~g" ~/.zen/game/players/$PLAYER/ipfs/moa/index.html # 8080 & 5001 BEING THE RECORDING GATEWAY (WAN or ipfs.localhost)