summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author= <pux@pux.dom>2023-01-07 14:15:09 +0100
committer= <pux@pux.dom>2023-01-07 14:15:09 +0100
commit16253d250ccf377b70b12d9430e4dcbaddded59e (patch)
tree426927c1fa22cdec3aa8d5f62acc34dd50f45204
parent61c744e104acea884a5cb6993405af6f685949bc (diff)
downloadpub-docs-16253d250ccf377b70b12d9430e4dcbaddded59e.tar.gz
pub-docs-16253d250ccf377b70b12d9430e4dcbaddded59e.tar.bz2
pub-docs-16253d250ccf377b70b12d9430e4dcbaddded59e.zip
add rfc822 pubDate
-rw-r--r--index.xml6
-rwxr-xr-xpyreplace.py2
-rwxr-xr-xrfc822date.py27
-rwxr-xr-xupdate.sh7
4 files changed, 36 insertions, 6 deletions
diff --git a/index.xml b/index.xml
index 88c9bd0..5bc093f 100644
--- a/index.xml
+++ b/index.xml
@@ -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)
diff --git a/update.sh b/update.sh
index baeca3a..e7cb139 100755
--- a/update.sh
+++ b/update.sh
@@ -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
in each repos: see "about"-tab (if existing) for more details / README.
mailto contact at omeckman dot net
all timestamps in UTC (German winter time: UTC+01:00, summer time: UTC+02:00)
dark theme is a modded version of: https://gist.github.com/Yoplitein/f4b671a2ec70c9e743fa