From 4d2b6ef2bec1906b8cffa700454a6c08153cc27f Mon Sep 17 00:00:00 2001 From: Holger Schurig Date: Wed, 23 Jun 2010 10:12:38 +0200 Subject: [PATCH] rss_feed.py: add a bit of atom support --- plugins/rss_feed.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/rss_feed.py b/plugins/rss_feed.py index a4197b1..9062767 100644 --- a/plugins/rss_feed.py +++ b/plugins/rss_feed.py @@ -67,6 +67,10 @@ def finish(params): lastBuildDate = datetime.datetime.now(), items = items, ) + # Step one of self-reference + # (see http://feedvalidator.org/docs/warning/MissingAtomSelfLink.html) + rss.rss_attrs["xmlns:atom"] = "http://www.w3.org/2005/Atom" + try: os.makedirs(cfg.out_dir) except: @@ -74,5 +78,7 @@ def finish(params): f = open(os.path.join(cfg.out_dir, cfg.rss_file), "w") # Ugly XML beautification s = rss.to_xml().replace("<", "\n<").replace("\n\n", "\n")[1:] + # Step two of self-reference + s = s.replace('', '\n' % (cfg.main_url, cfg.rss_file)) f.write(s) f.write("\n") -- 2.39.2