Make txt version content and enclosure link pdf version. - tgtimes - The Gopher Times
(HTM) git clone git://bitreich.org/tgtimes git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/tgtimes
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
---
(DIR) commit 54a44e815e4b30a8652bd3069f2f6062f60a11da
(DIR) parent c5089ceb5a678d669b98b10ac03295ebb1b948dc
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 29 Jan 2022 21:02:40 +0100
Make txt version content and enclosure link pdf version.
Diffstat:
M archive/mk-atom.sh | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
---
(DIR) diff --git a/archive/mk-atom.sh b/archive/mk-atom.sh
@@ -15,16 +15,23 @@ do
printf "\t\t<entry>\n"
printf "\t\t<id>%s</id>\n" "${uri}"
printf "\t\t<title><![CDATA[%s]]></title>\n" "${release}"
+ printf "\t\t<author><name>The Gopher Times Authors</name></author>\n"
+
cd ${release}
- find . -type f | cut -d'/' -f 2- \
- | while read -r releasefile;
- do
- mimetype="$(file --mime-type -b "${releasefile}")"
- printf "\t\t<link type=\"%s\" href=\"%s/%s\" />\n" \
+ txtedition=$(find . -type f -name "*.txt" | cut -d'/' -f 2-)
+ pdfedition=$(find . -type f -name "*.pdf" | cut -d'/' -f 2-)
+ printf "\t\t<content type=\"text\"><[!CDATA["
+ cat $txtedition
+ printf "]]></content>\n"
+
+ lastmodified=$(stat --printf="%Y" ${txtedition})
+ lastupdated="$(date +%FT%T%z -d @${lastmodified})"
+ printf "\t\t<updated>%s</updated>\n" "${lastupdated}"
+ mimetype="$(file --mime-type -b "${pdfedition}")"
+ printf "\t\t<link type=\"%s\" href=\"%s/%s\" />\n" \
"${mimetype}" \
"${uri}" \
- "${releasefile}"
- done
+ "${pdfedition}"
cd ..
printf "\t\t</entry>\n"
done