UPlanet PLAYER TW link $:/moa ( imageHASH change -> renew Tiddler )

This commit is contained in:
fred 2024-03-09 20:06:01 +01:00
parent eeb963d9f0
commit dbb50dade4
2 changed files with 17 additions and 0 deletions

View File

@ -301,15 +301,31 @@ for PLAYER in ${PLAYERONE[@]}; do
FG1PUB=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .g1pub')
echo "G1: $FG1PUB"
IHASH=$(cat ~/.zen/tmp/${MOATS}/FRIENDS.json | jq .[] | jq -r 'select(.title=="'${fp}'") | .text' | sha256sum | cut -d ' ' -f 1)
echo $IHASH
if [[ ${FTW} != "/ipns/" && ${FTW} != "null" && ${FTW} != "" ]]; then
## CHECK ALREADY IN IHASH
rm -f ~/.zen/tmp/${MOATS}/finside.json
tiddlywiki --load ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html \
--output ~/.zen/tmp/${MOATS} \
--render '.' 'finside.json' 'text/plain' '$:/core/templates/exporters/JsonFile' 'exportFilter' '${FPLAYER^^}' ## $:/moa EMAIL Tiddlers
FIHASH=$(cat ~/.zen/tmp/${MOATS}/finside.json | jq .[] | jq -r 'select(.title=="'${FPLAYER^^}'") | .ihash')
echo $FIHASH
## UPDATE IF IHASH CHANGED
if [[ ! $FIHASH || $FIHASH != $IHASH ]]; then
cat ${MY_PATH}/../templates/data/_UPPERFPLAYER_.json \
| sed -e "s~_UPPERFPLAYER_~${FPLAYER^^}~g" \
-e "s~_FPLAYER_~${FPLAYER}~g" \
-e "s~_IHASH_~${IHASH}~g" \
-e "s~_FRIENDTW_~${FTW}~g" \
-e "s~_PLAYER_~${PLAYER}~g" \
> ~/.zen/tmp/${MOATS}/${FPLAYER}.json
INPUTPLAYERS+=(" --import ${HOME}/.zen/tmp/${MOATS}/${FPLAYER}.json 'application/json' ") # Append to the array
fi
fi
done

View File

@ -3,6 +3,7 @@
"title": "_UPPERFPLAYER_",
"text": "\\procedure loadMyWiki()\n\\import [[$:/plugins/sq/ExternalContent/loadWikiActions]]\n<$transclude\n $variable=\"loadWikiActions\"\n wikiURL={{!!wikiURL}}\n contentFilter={{!!filter}}\n deseralizer=\"text/html\"\n />\n\\end\n\n<details open=\"yes\">\n <summary>_UPPERFPLAYER_ TW:</summary>\n <div>\n\n<$edit size=60 field=\"wikiURL\"/> ⬅︎ TW <br>\n<$edit size=50 field=\"filter\"/> ⬅︎ Filtration\n\n<<hspace>><$button actions=<<loadMyWiki>> > _UPPERFPLAYER_ TW </$button>\n\n </div>\n </details>\n\n[[EXTERNAL|EXTERNAL]]\n \n",
"tags": "_PLAYER_ $:/tags/load-external-content",
"ihash": "_IHASH_",
"filter": "[days[-1]!is[system]!tag[G1Voeu]]",
"wikiURL": "_FRIENDTW_",
"friend": "_FPLAYER_"