diff options
-rw-r--r-- | index.xml | 6 | ||||
-rwxr-xr-x | pyreplace.py | 2 | ||||
-rwxr-xr-x | rfc822date.py | 27 | ||||
-rwxr-xr-x | update.sh | 7 |
4 files changed, 36 insertions, 6 deletions
@@ -12,7 +12,7 @@ <item> <title>2020-06-23-182943_Backpacks</title> <link>https://omeckman.net/pub-docs/2020-06-23-182943_Backpacks.html</link> - <pubDate></pubDate> + <pubDate>Tue, 23 Jun 2020 18:29:43 +0000</pubDate> <guid>https://omeckman.net/pub-docs/2020-06-23-182943_Backpacks.html</guid> <description> 2020-06-23-182943_Backpacks @@ -22,7 +22,7 @@ <item> <title>2021-06-28-103922_TestingSrtGear</title> <link>https://omeckman.net/pub-docs/2021-06-28-103922_TestingSrtGear.html</link> - <pubDate></pubDate> + <pubDate>Mon, 28 Jun 2021 10:39:22 +0000</pubDate> <guid>https://omeckman.net/pub-docs/2021-06-28-103922_TestingSrtGear.html</guid> <description> 2021-06-28-103922_TestingSrtGear @@ -32,7 +32,7 @@ <item> <title>2022-09-24-190300_Nuki1Retrospective</title> <link>https://omeckman.net/pub-docs/2022-09-24-190300_Nuki1Retrospective.html</link> - <pubDate></pubDate> + <pubDate>Sat, 24 Sep 2022 19:03:00 +0000</pubDate> <guid>https://omeckman.net/pub-docs/2022-09-24-190300_Nuki1Retrospective.html</guid> <description> 2022-09-24-190300_Nuki1Retrospective diff --git a/pyreplace.py b/pyreplace.py index 751d711..71e970e 100755 --- a/pyreplace.py +++ b/pyreplace.py @@ -1,4 +1,4 @@ -#/usr/bin/env python3 +#!/bin/env python3 import sys diff --git a/rfc822date.py b/rfc822date.py new file mode 100755 index 0000000..8ea9446 --- /dev/null +++ b/rfc822date.py @@ -0,0 +1,27 @@ +#!/bin/env python3 + +from datetime import datetime +import sys + +def help(): + print(sys.argv[0] + " YYYY-MM-DD-HHMMSS [+XXXX]") + +# test +#indate = "2022-12-22-182343" + +timezone = "+0000" + +if len(sys.argv) <= 1: + print("error no arg") + help() + sys.exit() +if len(sys.argv) == 3: + timezone = sys.argv[2] +if len(sys.argv) > 3: + print("error > 2 args") + help() + sys.exit() + +indate = sys.argv[1] +d = datetime.strptime(indate, "%Y-%m-%d-%H%M%S") +print(d.strftime("%a, %d %b %Y %H:%M:%S") + " " + timezone) @@ -27,14 +27,17 @@ do then echo "[$filename_wo_ext]($filename_wo_ext.html) " >> INDEX.md + origdate=$(echo "$filename_wo_ext" | cut -f 1 -d '_') + pubdaterfc822=$(python3 rfc822date.py ${origdate}) + RSS_ITEM_TITLE="$filename_wo_ext" RSS_ITEM_LINK=${RSS_TITLE_LINK}${filename_wo_ext}.html - RSS_ITEM_PUBDATE="" + RSS_ITEM_PUBDATE=${pubdaterfc822} RSS_ITEM_DESC=$RSS_ITEM_TITLE cat template_rss_item.xml >> index.xml python3 pyreplace.py '$ITEM_TITLE$' "${RSS_ITEM_TITLE}" index.xml python3 pyreplace.py '$ITEM_LINK$' "${RSS_ITEM_LINK}" index.xml - python3 pyreplace.py '$ITEM_PUBDATE$' "${RSS_ITEM_PUIBDATE}" index.xml + python3 pyreplace.py '$ITEM_PUBDATE$' "${RSS_ITEM_PUBDATE}" index.xml python3 pyreplace.py '$ITEM_DESC$' "${RSS_ITEM_DESC}" index.xml fi |