summaryrefslogtreecommitdiff
path: root/.zs/rss
blob: 7eb9fc83b3821334557fe5fac74a50323c8a60d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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-