aboutsummaryrefslogtreecommitdiff
path: root/rssg
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-04 17:01:12 +0000
committerng0 <ng0@n0.is>2019-11-04 17:01:12 +0000
commita53325f36b12384477b2f1735e897f6db99701c6 (patch)
tree2a973d57ecf31b27847c7d5a76549bf43114d5cf /rssg
parent84bd8b1bf331ca57074d97f7ff2c73cc07af2b02 (diff)
downloadwww-a53325f36b12384477b2f1735e897f6db99701c6.tar.gz
www-a53325f36b12384477b2f1735e897f6db99701c6.zip
guybrush threepwood meets macgyver on a bad day, now there's a hopefully working hack for what didn't work.
Diffstat (limited to 'rssg')
-rwxr-xr-xrssg12
1 files changed, 11 insertions, 1 deletions
diff --git a/rssg b/rssg
index 05ca9431..7f5373cb 100755
--- a/rssg
+++ b/rssg
@@ -140,6 +140,16 @@ date_rfc_822() {
140} 140}
141 141
142 142
143feed_date_rfc_822() {
144 if date --version >/dev/null 2>&1; then
145 date -d "$(echo "$1")" --rfc-822
146 else
147 date -j '+%a, %d %b %Y %H:%M:%S %z' \
148 "$(echo "$1"| tr -cd '[:digit:]')0000"
149 fi
150}
151
152
143render_items() { 153render_items() {
144 while read -r i 154 while read -r i
145 do render_item "$1" "$2" "$i" 155 do render_item "$1" "$2" "$i"
@@ -200,7 +210,7 @@ render_feed() {
200<language>en</language> 210<language>en</language>
201<description>'"$description"'</description> 211<description>'"$description"'</description>
202<link>'"$base_url"'/</link> 212<link>'"$base_url"'/</link>
203<lastBuildDate>'"$(date_rfc_822 date)"'</lastBuildDate> 213<lastBuildDate>'"$(feed_date_rfc_822 date)"'</lastBuildDate>
204'"$(cat)"' 214'"$(cat)"'
205</channel></rss>' 215</channel></rss>'
206} 216}