From a53325f36b12384477b2f1735e897f6db99701c6 Mon Sep 17 00:00:00 2001 From: ng0 Date: Mon, 4 Nov 2019 17:01:12 +0000 Subject: guybrush threepwood meets macgyver on a bad day, now there's a hopefully working hack for what didn't work. --- rssg | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'rssg') diff --git a/rssg b/rssg index 05ca9431..7f5373cb 100755 --- a/rssg +++ b/rssg @@ -140,6 +140,16 @@ date_rfc_822() { } +feed_date_rfc_822() { + if date --version >/dev/null 2>&1; then + date -d "$(echo "$1")" --rfc-822 + else + date -j '+%a, %d %b %Y %H:%M:%S %z' \ + "$(echo "$1"| tr -cd '[:digit:]')0000" + fi +} + + render_items() { while read -r i do render_item "$1" "$2" "$i" @@ -200,7 +210,7 @@ render_feed() { en '"$description"' '"$base_url"'/ -'"$(date_rfc_822 date)"' +'"$(feed_date_rfc_822 date)"' '"$(cat)"' ' } -- cgit v1.2.3