[ $howmuch -gt 220 ] && BIGCHAN="${channel}($howmuch) $BIGCHAN" && continue

This commit is contained in:
fred 2022-10-15 20:47:47 +02:00
parent 948fe6b8dd
commit 0b43802a97
2 changed files with 9 additions and 3 deletions

View File

@ -417,7 +417,10 @@ echo "##########################################################################
sed -i "s~_VUID_~$INDEX/$VUID~g" ~/.zen/bunkerbox/homepage/index.html
sed -i "s/_WHO_/$(date -u "+%Y-%m-%d#%H:%M:%S")@$IPFSNODEID/g " ~/.zen/bunkerbox/homepage/index.html
sed -i "s~_TITLE_~$TITLE~g" ~/.zen/bunkerbox/homepage/index.html
TAGS=$(${MY_PATH}/tools/get_tagcloud_data.sh $IPNS)
${MY_PATH}/tools/get_tagcloud_data.sh $IPNS
TAGS=$(cat ~/.zen/tmp/chan_cloud.json | jq -c .[])
sed -i "s~_TAGCLOUD_~$TAGS~g" ~/.zen/bunkerbox/homepage/index.html
# Copy json's

View File

@ -7,9 +7,11 @@ IPNS="$1"
echo '{"data":[]}' > ~/.zen/tmp/chan_cloud.json
for channel in $(ls ~/.zen/bunkerbox/channels); do
howmuch=$(jq '.Videos | length' ~/.zen/bunkerbox/history.${channel}.json)
[[ -s ~/.zen/bunkerbox/history.${channel}.json ]] && howmuch=$(jq '.Videos | length' ~/.zen/bunkerbox/history.${channel}.json)
[[ ! $howmuch ]] && continue
echo "Adding $channel ($howmuch videos)"
[ $howmuch -gt 220 ] && BIGCHAN="${channel}($howmuch) $BIGCHAN" && continue
cat ~/.zen/tmp/chan_cloud.json | jq '.data += [{"name": "'''$channel'''", "link": "/ipns/'''$IPNS'''/tw/'''$channel'''", "weight": "'''$howmuch'''" ,"tooltip": "'''$channel'''"}]' > ~/.zen/tmp/chan_cloud_plus.json
@ -17,4 +19,5 @@ for channel in $(ls ~/.zen/bunkerbox/channels); do
done
cat ~/.zen/tmp/chan_cloud.json | jq -c .[]
## "data:" dans le template homepage.html