From 3d3dc41c560e71109d890e9a7203b0a3b22f6598 Mon Sep 17 00:00:00 2001 From: garret Date: Tue, 9 Jul 2024 17:00:20 +0100 Subject: add public (static) version --- kadomatsu-rss.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'kadomatsu-rss.py') diff --git a/kadomatsu-rss.py b/kadomatsu-rss.py index a876402..47a7e68 100755 --- a/kadomatsu-rss.py +++ b/kadomatsu-rss.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import cgi +import os from datetime import datetime @@ -73,3 +74,8 @@ if __name__ == "__main__": print("Content-Type: application/rss+xml; charset=UTF-8") print() print(feed.writeString("utf-8")) + + public_file_path = os.getenv("KADOMATSU_RSS_FILE") + if public_file_path is not None: + with open(public_file_path, "w") as public_file: + feed.write(public_file, 'utf-8') -- cgit v1.2.3-70-g09d2