]> oss.titaniummirror.com Git - webber.git/blobdiff - plugins/rss_feed.py
rss_feed.py: the guid isn't a permalink
[webber.git] / plugins / rss_feed.py
index 28b0efcc7346d79b322a90cab2e18bcca570e03f..0681b39dbd18b1f030dd7fbafd4457d9cc33e693 100644 (file)
@@ -1,6 +1,11 @@
 # -*- coding: iso-8859-1 -*-
 from webber import *
-import os, datetime, PyRSS2Gen
+import os, datetime
+try:
+       import PyRSS2Gen
+except ImportError:
+       print "rss_feed needs the python module PyRSS2Gen"
+       raise
 
 items = []
 
@@ -35,16 +40,18 @@ def sitemap_scan(params):
        file = params.file
        if not file.has_key("linktitle"):
                return
-       if not file.has_key("change"):
-               return
+       if file.has_key("change"):
+               change = file["change"]
+       else:
+               change = ""
 
        fname_out = os.path.join(cfg.out_dir, file.out_path)
        full_url = "http://%s/%s" % (cfg.main_url, fname_out)
        item = PyRSS2Gen.RSSItem(
                title = file["title"],
                link = full_url,
-               guid = PyRSS2Gen.Guid("%s %s" % (full_url, file["mtime"])),
-               description = file["change"],
+               guid = PyRSS2Gen.Guid("%s %s" % (full_url, file["mtime"]), isPermaLink=0),
+               description = change,
                pubDate = datetime.datetime.fromtimestamp(file["mtime"], utc),
        )
        items.append(item)