summaryrefslogtreecommitdiff
path: root/cgi-bin/rss.sh
diff options
context:
space:
mode:
authorAdam T. Carpenter <atc@53hor.net>2021-06-07 21:47:07 -0400
committerAdam T. Carpenter <atc@53hor.net>2021-06-07 21:47:07 -0400
commitdd75b4a341925e4ba3408b018941241d4317dd9f (patch)
tree58803a50c84b2ec2278a88186ccbfabba3399f8f /cgi-bin/rss.sh
parentc1abd776510d69f6f35ef449875c48b46a5ca95a (diff)
download53hor-dd75b4a341925e4ba3408b018941241d4317dd9f.tar.xz
53hor-dd75b4a341925e4ba3408b018941241d4317dd9f.zip
updated with cgi scripts to create on-the-fly rss and index
Diffstat (limited to 'cgi-bin/rss.sh')
-rwxr-xr-xcgi-bin/rss.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/cgi-bin/rss.sh b/cgi-bin/rss.sh
new file mode 100755
index 0000000..6987745
--- /dev/null
+++ b/cgi-bin/rss.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Generates an RSS feed from all posts.
+
+cat << EOH
+content-type: application/xml
+
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE xml>
+<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>53hornet's Feed</title>
+ <link>https://www.53hor.net</link>
+ <atom:link href="https://www.53hor.net/rss.xml" rel="self" type="application/rss+xml" />
+ <description>The World Wide Web pages of Adam Carpenter</description>
+ <image>
+ <url>https://www.53hor.net/includes/logo_diag.png</url>
+ <title>53hornet's Feed</title>
+ <link>https://www.53hor.net</link>
+ </image>
+EOH
+
+grep '<h1>' posts/*\
+ | sort -r\
+ | sed -e 's#h1#title#g' -e 's#:#</link>#' -e 's#$#</item>#' -e 's#^#<item><link>https://www.53hor.net/#'
+
+echo '</channel></rss>'
+