summaryrefslogtreecommitdiff
path: root/.zs/rss
diff options
context:
space:
mode:
Diffstat (limited to '.zs/rss')
-rwxr-xr-x.zs/rss19
1 files changed, 19 insertions, 0 deletions
diff --git a/.zs/rss b/.zs/rss
new file mode 100755
index 0000000..e118172
--- /dev/null
+++ b/.zs/rss
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+for f in ./blog/*.md ; do
+ d="$(zs var "$f" date)"
+ if [ ! -z $d ] ; then
+ timestamp="$(date --date "$(echo "$d" | awk -F- '{print $3"-"$2"-"$1}')" +%s)"
+ url="$(zs var "$f" url)"
+ title="$(zs var "$f" title)"
+ desc="$(zs var "$f" description)"
+ echo $timestamp \
+ "<item>" \
+ "<title>$title</title>" \
+ "<link>http://darkuss.twoexem.com/$url</link>" \
+ "<description>$desc</description>" \
+ "<pubDate>$(date --date @$timestamp -R)</pubDate>" \
+ "<guid>http://darkuss.twoexem.com/$url</guid>" \
+ "</item>"
+ fi
+done | sort -r -n | cut -d' ' -f2-