This commit is contained in:
localhost_frssoft 2023-01-11 19:27:09 +03:00
parent d82fc393d1
commit 5d0b79caf0
1 changed files with 6 additions and 5 deletions

View File

@ -29,14 +29,15 @@ get_Lies_pages()
get_Lies_pages > "$basedir"/response.json
for i in $(jj -l -i "$basedir"/response.json 'data.#.id'); do
for i in $(jq '.["data"] | .[].id' "$basedir"/response.json); do
raw_id=$(echo $i | tr -d '"')
if [ ! -f $baseblogdir/$raw_id.gmi ]; then
entry_json=$(jq ".[\"data\"] | .[] | select(.id==$i)" "$basedir"/response.json)
orig=$(echo $i | sed -e 's/"//g; s|^|https://dybr.ru/blog/liesliasau/|g')
title=$(jj -i "$basedir"/response.json "data.#[id=$i].attributes.title")
published=$(jq -r ".[] | .[] | select(.id==$i) | .attributes[\"created-at\"]" "$basedir"/response.json)
tags=$(jj -l -i "$basedir"/response.json "data.#[id=$i].attributes.tags" | sed -e 's/"//g' | tr '\n' ',')
content=$(jj -i "$basedir"/response.json "data.#[id=$i].attributes.content")
title=$(echo "$entry_json" | jq -r ".attributes[\"title\"]")
published=$(echo "$entry_json" | jq -r ".attributes[\"created-at\"]")
tags=$(echo "$entry_json" | jq -r ".attributes[\"tags\"] | .[]" | tr '\n' ',')
content=$(echo "$entry_json" | jq -r ".attributes[\"content\"]")
links_img=$(echo "$content" | pup 'img attr{src}' | sed 's|^|https://dybr.ru|g')
plain_content=$(echo "$content" | w3m -T text/html -cols 65535 -dump -o display_link_number=1 | sed -e 's|\[MORE=.*\]||g ; s|\[/MORE\]||g ; s|\[S:|~~|g ; s|:S\]|~~|g')
# Unpack inline images...