Fixed broken pubdate and added missing GUIDs

This commit is contained in:
2022-03-14 02:16:18 +08:00
parent f07858bf79
commit bd76e6e9b6
3 changed files with 27 additions and 26 deletions

View File

@ -48,15 +48,16 @@ itemlinereplace=$(grep -n '$item' .rss.item.template | cut -f1 -d:)
# build rss feed
cat \
<(head -n $(( linereplace -1 )) .rss.template) \
<(head -n $(( linereplace -1 )) .rss.template |
sed "s/PUBDATE/$(date -R)/" ) \
<(
for ((i=1;i<10;i++))
do
itemnum=$(( CONTENTNUM - i ))
padint=$(printf %03d $itemnum)
title=$(jq '.data | .['"$padint"'].title' .data.json )
pubdate=$(jq '.data | .['"$padint"'].published_date' .data.json )
guid=$(jq '.data | .['"$padint"'].guid' .data.json )
title=$(jq -r '.data | .['"$padint"'].title' .data.json )
pubdate=$(jq -r '.data | .['"$padint"'].published_date' .data.json )
guid=$(jq -r '.data | .['"$padint"'].guid' .data.json )
cat \
<(head -n $(( itemlinereplace -1 )) .rss.item.template |
sed "s/TITLE/$title/;
@ -64,7 +65,7 @@ cat \
) \
<(cat content-$padint quote-$padint |
tidy -q -asxml |
xq -cx '.html.body' ) \
xq -rcx '.html.body' ) \
<(tail -n +$(( itemlinereplace +1 )) .rss.item.template |
sed "s/PUBDATE/$pubdate/;
s/GUID/$guid/"