correct RSS/all.json

This commit is contained in:
fred 2023-12-30 14:20:26 +01:00
parent a8990ce2df
commit 002d9ff599
1 changed files with 6 additions and 3 deletions

View File

@ -338,9 +338,12 @@ echo "<meta http-equiv=\"refresh\" content=\"0; url='/ipfs/${ZCHAIN}' />" > ~/.z
data=$(jq '.' "$file")
json_array+=("$data")
done
# Convert the array to a single JSON object
merged_json=$(jq -n '{"data": [ $json_array[] ]}')
echo "$merged_json" > ~/.zen/tmp/${MOATS}/${UMAP}/RSS/all.json
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"
##############################################################
############################ PUBLISHING UMAP