From 0b101f5b9d98f972ab9f72e983534412a53dc102 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Tue, 18 Sep 2018 00:14:04 -0400 Subject: Add atom feed generator --- feed.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 feed.sh (limited to 'feed.sh') diff --git a/feed.sh b/feed.sh new file mode 100755 index 00000000..4a45ce45 --- /dev/null +++ b/feed.sh @@ -0,0 +1,25 @@ +#!/bin/sh +set -e -u + +updated=$(date -u '+%FT%TZ') +echo '' +echo '' +echo 'Causal Agency' +echo 'Junejune@causal.agency' +echo '' +echo 'https://text.causal.agency/' +echo "${updated}" +for entry in *.7; do + url="https://text.causal.agency/${entry%.7}.txt" + title=$(grep '^\.Nm' "$entry" | cut -c 5-) + summary=$(grep '^\.Nd' "$entry" | cut -c 5-) + updated=$(date -j -u -f '%s' "$(stat -f '%m' "$entry")" '+%FT%TZ') + echo '' + echo "${title}" + echo "${summary}" + echo "" + echo "${url}" + echo "${updated}" + echo '' +done +echo '' -- cgit 1.4.1