From 517f384181e27d0969f7d4dc5d59a29e775dc6a5 Mon Sep 17 00:00:00 2001 From: fred Date: Thu, 25 Apr 2024 00:52:41 +0200 Subject: [PATCH] 00:52 --- RUNTIME/PLAYER.refresh.sh | 111 ++++++++++++++++++------------------- RUNTIME/UPLANET.refresh.sh | 2 +- install.sh | 48 ++++++++-------- microledger.me.sh | 0 4 files changed, 80 insertions(+), 81 deletions(-) mode change 100644 => 100755 microledger.me.sh diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index b2c6239e..94eb6c70 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -537,74 +537,71 @@ for PLAYER in ${PLAYERONE[@]}; do > ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ######################################################### - ##### AFTER 2 WEEKS : START TW JSON RSS EXPORT - if [[ ${days} -ge 14 ]]; then - ################### - # REFRESH PLAYER_feed KEY - echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) RSS" + ##### TW JSON RSS EXPORT + ################### + # REFRESH PLAYER_feed KEY + echo "(☉_☉ ) (☉_☉ ) (☉_☉ ) RSS" - ######################################################################################### - ## CREATING 30 DAYS JSON RSS STREAM - # [days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]] - ######################################################################################### - tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \ - --output ~/.zen/game/players/${PLAYER}/ipfs \ - --render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]]' + ######################################################################################### + ## CREATING 30 DAYS JSON RSS STREAM + # [days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]] + ######################################################################################### + tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \ + --output ~/.zen/game/players/${PLAYER}/ipfs \ + --render '.' "${PLAYER}.rss.json" 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '[days:created[-30]!is[system]!tag[G1Voeu]!externalTiddler[yes]!tag[load-external]]' - [[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ]] \ - && echo "NO ${PLAYER} RSS - BAD " + [[ ! -s ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ]] \ + && echo "NO ${PLAYER} RSS - BAD " - echo "~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json" + echo "~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json" - ######################################################## - #### PLAYER ACCOUNT HAVE NEW TIDDLER or NOT ######### - if [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" && "${CURRENT}" != "${PLAYER}" ]]; then - echo "ALERT -- RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN -- $days DAYS" - ## DEAD PLAYER ?? - if [[ ${days} -eq 27 ]]; then - echo " -

🔋WARNING

" > ~/.zen/tmp/alert - echo "

${PLAYER} TW 🔌📺

🌥 $ZEN ZEN 🌥 " >> ~/.zen/tmp/alert - - ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/alert "TW ALERT" - echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" - fi - if [[ ${days} -gt 29 ]]; then - #################################### UNPLUG ACCOUNT - echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN" - ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL" - continue - fi - - ## PAY 1 ZEN TO UMAPG1PUB - [[ "${UMAPG1PUB}" != "" ]] \ - && ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "0.1" "${UMAPG1PUB}" "UPLANET:TW:${YOUSER}:/ipfs/${TW}" - - else - - ### PLAYER ALIVE PUBLISH RSS & - FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1) - [[ ${FEEDNS} ]] \ - && IRSS=$(ipfs add --pin=false -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \ - && echo "Publishing ${PLAYER}_feed: /ipns/${FEEDNS} => /ipfs/${IRSS}" \ - && ipfs --timeout 300s name publish --key="${PLAYER}_feed" /ipfs/${IRSS} \ - || echo ">>>>> WARNING ${PLAYER}_feed IPNS KEY PUBLISHING CUT - WARNING" + ######################################################## + #### PLAYER ACCOUNT HAVE NEW TIDDLER or NOT ######### + if [[ $(cat ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json) == "[]" && "${CURRENT}" != "${PLAYER}" ]]; then + echo "ALERT -- RSS IS EMPTY -- COINS=$COINS / ZEN=$ZEN -- $days DAYS" + ## DEAD PLAYER ?? + if [[ ${days} -eq 27 ]]; then + echo " +

🔋WARNING

" > ~/.zen/tmp/alert + echo "

${PLAYER} TW 🔌📺

🌥 $ZEN ZEN 🌥 " >> ~/.zen/tmp/alert + ${MY_PATH}/../tools/mailjet.sh "${PLAYER}" ~/.zen/tmp/alert "TW ALERT" + echo "<<<< PLAYER TW WARNING <<<< ${DIFF_SECONDS} > ${days} days" + fi + if [[ ${days} -gt 29 ]]; then + #################################### UNPLUG ACCOUNT + echo ">>>> PLAYER TW UNPLUG >>>>> ${days} days => BYE BYE ${PLAYER} ZEN=$ZEN" + ${MY_PATH}/PLAYER.unplug.sh ~/.zen/game/players/${PLAYER}/ipfs/moa/index.html ${PLAYER} "ALL" + continue fi - echo "${PLAYER}" \ - > ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html + ## PAY 1 ZEN TO UMAPG1PUB + [[ "${UMAPG1PUB}" != "" ]] \ + && ${MY_PATH}/../tools/PAY4SURE.sh "${HOME}/.zen/game/players/${PLAYER}/secret.dunikey" "0.1" "${UMAPG1PUB}" "UPLANET:TW:${YOUSER}:/ipfs/${TW}" + + else + + ### PLAYER ALIVE PUBLISH RSS & + FEEDNS=$(ipfs key list -l | grep -w "${PLAYER}_feed" | cut -d ' ' -f 1) + [[ ${FEEDNS} ]] \ + && IRSS=$(ipfs add --pin=false -q ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json | tail -n 1) \ + && echo "Publishing ${PLAYER}_feed: /ipns/${FEEDNS} => /ipfs/${IRSS}" \ + && ipfs --timeout 300s name publish --key="${PLAYER}_feed" /ipfs/${IRSS} \ + || echo ">>>>> WARNING ${PLAYER}_feed IPNS KEY PUBLISHING CUT - WARNING" fi + echo "${PLAYER}" \ + > ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}.feed.html + ######################################################### ## TODO CREATING 30 DAYS XML RSS STREAM ??? ## https://talk.tiddlywiki.org/t/has-anyone-generated-an-rss-feed-from-tiddlywiki/966/26 # tiddlywiki.js --load my-wiki.html --render "[[$:/plugins/sq/feeds/templates/rss]]" "feed.xml" "text/plain" "$:/core/templates/wikified-tiddler" diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index 18da970f..f95b1fe2 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -100,7 +100,7 @@ for UMAP in ${unique_combined[@]}; do start=`date +%s` # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> mkdir ~/.zen/tmp/${MOATS}/${UMAP} - echo "## IPFS GET YESTERDATENS" + echo "## IPFS GET YESTERDATENS /ipns/${YESTERDATENS}/" ipfs --timeout 300s get --progress=false -o ~/.zen/tmp/${MOATS}/${UMAP}/ /ipns/${YESTERDATENS}/ if [[ $? != 0 ]]; then echo "(╥☁╥ ) swarm online memory empty (╥☁╥ )" diff --git a/install.sh b/install.sh index c8a975c7..e0c56766 100755 --- a/install.sh +++ b/install.sh @@ -92,16 +92,32 @@ for i in cmatrix cowsay fonts-hack-ttf; do done if [[ $(which X 2>/dev/null) ]]; then -echo "#############################################" -echo "######### INSTALL DESKTOP TOOLS ######" -echo "#############################################" -for i in x11-utils xclip zenity kodi; do - if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then - echo ">>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - sudo apt install -y $i; - [[ $? != 0 ]] && echo "INSTALL $i FAILED." && echo "INSTALL $i FAILED." >> /tmp/install.errors.log && continue + echo "#############################################" + echo "######### INSTALL DESKTOP TOOLS ######" + echo "#############################################" + for i in x11-utils xclip zenity kodi; do + if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ]; then + echo ">>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Installation $i <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + sudo apt install -y $i; + [[ $? != 0 ]] && echo "INSTALL $i FAILED." && echo "INSTALL $i FAILED." >> /tmp/install.errors.log && continue + fi + done + + + if [[ $(which kodi) && $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]]; then + echo "#############################################" + echo " ### CONFIGURATION KODI FR PLUGIN ## " + echo "#############################################" + ( + mkdir -p ~/.zen/tmp/kodi + echo "PATIENTEZ..." + ipfs get -o ~/.zen/tmp/kodi/ /ipfs/Qmc2jg96KvQrLs5R29jn3hjUb1ViMWzeygtPR59fTP6AVT + echo '## INSTALL FRANCETV + VSTREAM + FILMSFORACTION' + mv ~/.kodi ~/.kodi.back 2>/dev/null + mv ~/.zen/tmp/kodi ~/.kodi + echo "Now run kodi and update plugins" + ) & fi -done fi #### GIT CLONE ############################################################### @@ -219,20 +235,6 @@ echo "/ip4/127.0.0.1/tcp/5001" > ~/.ipfs/api echo "=== SETUP ASTROPORT" ~/.zen/Astroport.ONE/setup.sh -#~ if [[ $(which kodi) && $XDG_SESSION_TYPE == 'x11' || $XDG_SESSION_TYPE == 'wayland' ]]; then -#~ echo "#############################################" -#~ echo " ### BONUS APP ## IPFS # KODI FR PLUGIN ## " -#~ echo "#############################################" -#~ ( - #~ mkdir -p ~/.zen/tmp/kodi - #~ echo "PATIENTEZ..." - #~ ipfs get -o ~/.zen/tmp/kodi/ /ipfs/Qmc2jg96KvQrLs5R29jn3hjUb1ViMWzeygtPR59fTP6AVT - #~ echo '## INSTALL FRANCETV + VSTREAM + FILMSFORACTION' - #~ mv ~/.kodi ~/.kodi.back 2>/dev/null - #~ mv ~/.zen/tmp/kodi ~/.kodi -#~ ) & -#~ fi - end=`date +%s` echo Installation time was `expr $end - $start` seconds. echo "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" diff --git a/microledger.me.sh b/microledger.me.sh old mode 100644 new mode 100755