No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

feed.sh 762B

1234567891011121314151617181920212223242526272829
  1. #!/bin/sh
  2. set -e -u
  3. updated=$(date -u '+%FT%TZ')
  4. cat <<EOF
  5. <?xml version="1.0" encoding="utf-8"?>
  6. <feed xmlns="http://www.w3.org/2005/Atom">
  7. <title>Causal Agency</title>
  8. <author><name>June</name><email>june@causal.agency</email></author>
  9. <link href="https://text.causal.agency"/>
  10. <id>https://text.causal.agency/</id>
  11. <updated>${updated}</updated>
  12. EOF
  13. for entry in *.7; do
  14. url="https://text.causal.agency/${entry%.7}.txt"
  15. title=$(grep '^\.Nm' "$entry" | cut -c 5-)
  16. summary=$(grep '^\.Nd' "$entry" | cut -c 5-)
  17. updated=$(date -j -u -f '%s' "$(stat -f '%m' "$entry")" '+%FT%TZ')
  18. cat <<EOF
  19. <entry>
  20. <title>${title}</title>
  21. <summary>${summary}</summary>
  22. <link href="${url}"/>
  23. <id>${url}</id>
  24. <updated>${updated}</updated>
  25. </entry>
  26. EOF
  27. done
  28. echo '</feed>'