CREATE .all.json for RSS in NODE and UPLANET published data

This commit is contained in:
fred 2024-01-07 22:22:57 +01:00
parent 733b848c5b
commit 27a5b5dccb
2 changed files with 3 additions and 14 deletions

View File

@ -348,6 +348,7 @@ for PLAYER in ${PLAYERONE[@]}; do
[[ ${LAT} && ${LON} ]] \
&& mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS/ \
&& cp ~/.zen/game/players/${PLAYER}/ipfs/${PLAYER}.rss.json ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS/ \
&& ${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/RSS \
&& mkdir -p ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/TW/${PLAYER} \
&& cp ~/.zen/tmp/${IPFSNODEID}/TW/${PLAYER}/index.html ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/TW/${PLAYER}/ \
&& echo "<meta http-equiv=\"refresh\" content=\"0; url='${UMAPNS}'\" />" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/_index.html

View File

@ -343,20 +343,8 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />" > ~/.z
###########################################################################################
########################################################
## COMBINE ALL JSON
json_array=()
# Loop through each *.rss.json file and append its content to the array
for file in ~/.zen/tmp/${MOATS}/${UMAP}/RSS/*.rss.json; do
# Use jq to extract the JSON array from each file
data=$(jq '.' "$file")
json_array+=("$data")
done
temp_file=$(mktemp)
printf '%s\n' "${json_array[@]}" > "$temp_file"
# Use jq to read the array from the temporary file and create the merged JSON
jq -n --slurpfile array "$temp_file" '{"data": $array}' > ~/.zen/tmp/${MOATS}/${UMAP}/RSS/all.json
# Remove the temporary file
rm "$temp_file"
## CREATE .all.json for RSS in this UMAP
${MY_PATH}/../tools/json_dir.all.sh ~/.zen/tmp/${MOATS}/${UMAP}/RSS
##############################################################
############################ PUBLISHING UMAP