about summary refs log tree commit diff
path: root/www/text.causal.agency/feed.sh
diff options
context:
space:
mode:
authorC. McEnroe <june@causal.agency>2019-07-27 17:00:47 -0400
committerC. McEnroe <june@causal.agency>2019-07-27 17:00:47 -0400
commit76c6a9b42a3604d30911c96d5ce4ae3c9be4de97 (patch)
treea923f81ad039cdacc7b1e29153a5a27ae2d30868 /www/text.causal.agency/feed.sh
parentAdd c11.pdf (diff)
downloadsrc-76c6a9b42a3604d30911c96d5ce4ae3c9be4de97.tar.gz
src-76c6a9b42a3604d30911c96d5ce4ae3c9be4de97.zip
Shell script style pass
Diffstat (limited to 'www/text.causal.agency/feed.sh')
-rw-r--r--[-rwxr-xr-x]www/text.causal.agency/feed.sh39
1 files changed, 20 insertions, 19 deletions
diff --git a/www/text.causal.agency/feed.sh b/www/text.causal.agency/feed.sh
index 3c6e658..21b1d4a 100755..100644
--- a/www/text.causal.agency/feed.sh
+++ b/www/text.causal.agency/feed.sh
@@ -1,29 +1,30 @@
 #!/bin/sh
-set -e -u
+set -eu
 
 updated=$(date -u '+%FT%TZ')
-cat <<EOF
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>Causal Agency</title>
-<author><name>June</name><email>june@causal.agency</email></author>
-<link href="https://text.causal.agency"/>
-<id>https://text.causal.agency/</id>
-<updated>${updated}</updated>
+cat <<- EOF
+	<?xml version="1.0" encoding="utf-8"?>
+	<feed xmlns="http://www.w3.org/2005/Atom">
+	<title>Causal Agency</title>
+	<author><name>June</name><email>june@causal.agency</email></author>
+	<link href="https://text.causal.agency"/>
+	<id>https://text.causal.agency/</id>
+	<updated>${updated}</updated>
 EOF
 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')
-	cat <<EOF
-	<entry>
-	<title>${title}</title>
-	<summary>${summary}</summary>
-	<link href="${url}"/>
-	<id>${url}</id>
-	<updated>${updated}</updated>
-	</entry>
-EOF
+	mtime=$(stat -f '%m' "$entry")
+	updated=$(date -ju -f '%s' "$mtime" '+%FT%TZ')
+	cat <<- EOF
+		<entry>
+		<title>${title}</title>
+		<summary>${summary}</summary>
+		<link href="${url}"/>
+		<id>${url}</id>
+		<updated>${updated}</updated>
+		</entry>
+	EOF
 done
 echo '</feed>'