From 27a5b5dccb7fee8fb75bc42b439ecd64f6cce1fb Mon Sep 17 00:00:00 2001 From: fred Date: Sun, 7 Jan 2024 22:22:57 +0100 Subject: [PATCH] CREATE .all.json for RSS in NODE and UPLANET published data --- RUNTIME/PLAYER.refresh.sh | 1 + RUNTIME/UPLANET.refresh.sh | 16 ++-------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/RUNTIME/PLAYER.refresh.sh b/RUNTIME/PLAYER.refresh.sh index 3c0f4d636..9248a0f2c 100755 --- a/RUNTIME/PLAYER.refresh.sh +++ b/RUNTIME/PLAYER.refresh.sh @@ -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 "" > ~/.zen/tmp/${IPFSNODEID}/UPLANET/_${LAT}_${LON}/_index.html diff --git a/RUNTIME/UPLANET.refresh.sh b/RUNTIME/UPLANET.refresh.sh index 382b4780b..186ede06e 100755 --- a/RUNTIME/UPLANET.refresh.sh +++ b/RUNTIME/UPLANET.refresh.sh @@ -343,20 +343,8 @@ echo "" > ~/.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