Add news.atom.xml generation. - 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 7105178f2c22dff02d1b1a6c4f8af2f66ac8a56f
(DIR) parent a58b77f39a71e77dc313f761d81ed81b4c29485d
(HTM) Author: Christoph Lohmann <20h@r-36.net>
Date: Sat, 29 Jan 2022 14:33:01 +0100
Add news.atom.xml generation.
Diffstat:
A archive/mk-atom.sh | 30 ++++++++++++++++++++++++++++++
A archive/news.atom.footer.xml | 1 +
A archive/news.atom.head.xml | 7 +++++++
M mkfile | 1 +
M opus3/tgtimes3.pdf | 0
5 files changed, 39 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/archive/mk-atom.sh b/archive/mk-atom.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+archivebaseuri="gopher://bitreich.org/9/tgtimes/archive"
+
+releases="$(find . -type d | tail -n +2 | cut -d'/' -f 2-)"
+
+cat news.atom.head.xml
+
+updated="$(date +%FT%T%z)"
+printf "\t<updated>%s</updated>\n" "${updated}"
+
+for release in $releases;
+do
+ uri="${archivebaseuri}/${release}"
+ printf "\t\t<entry>\n"
+ printf "\t\t<id>%s</id>\n" "${uri}"
+ printf "\t\t<title><![CDATA[%s]]></title>\n" "${release}"
+ cd ${release}
+ find . -type f | cut -d'/' -f 2- \
+ | while read -r releasefile;
+ do
+ printf "\t\t<link href=\"%s/%s\" />\n" "${uri}" \
+ "${releasefile}"
+ done
+ cd ..
+ printf "\t\t</entry>\n"
+done
+
+cat news.atom.footer.xml
+
(DIR) diff --git a/archive/news.atom.footer.xml b/archive/news.atom.footer.xml
@@ -0,0 +1 @@
+</feed>
(DIR) diff --git a/archive/news.atom.head.xml b/archive/news.atom.head.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>The Gopher Times</title>
+ <subtitle type="text">All the best news around gopherspace.</subtitle>
+ <id>gopher://bitreich.org/0/tgtimes/news.atom.xml</id>
+ <link href="gopher://bitreich.org/0/tgtimes/news.atom.xml" rel="self" />
+ <link href="gopher://bitreich.org/1/tgtimes" />
(DIR) diff --git a/mkfile b/mkfile
@@ -23,3 +23,4 @@ publish:V: $tgtimes.pdf $tgtimes.txt
cp $tgtimes.txt archive/$date/tgtimes-$date-opus$v.txt
cp $tgtimes.pdf archive/$date/tgtimes-$date-opus$v.pdf
cp $tgtimes.mw archive/$date/tgtimes-$date-opus$v.mw
+ cd archive && ./mk-atom.sh > news.atom.xml
(DIR) diff --git a/opus3/tgtimes3.pdf b/opus3/tgtimes3.pdf
Binary files differ.