Add author information in the RSS feed.
Tue Aug 23 23:54:36 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Add author information in the RSS feed.
Thanks to Remko Troncon for the initial implementation; this is basically the
same with the logic simplified a bit.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2015-10-18 18:44:51.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2015-10-18 18:44:51.000000000 +0000
@@ -1197,14 +1197,26 @@
time.localtime(p.date))
link = '%s/%s;a=commit;h=%s' % (config.myurl,
config.myreponame, p.hash)
+
+ # the author field is tricky because the standard requires it
+ # has an email address; so we need to check that and lie
+ # otherwise; there's more info at
+ # http://feedvalidator.org/docs/error/InvalidContact.html
+ if "@" in p.author:
+ author = p.author
+ else:
+ author = "%s <unknown@email>" % p.author
+
print """
<item>
<title>%(title)s</title>
+ <author>%(author)s</author>
<pubDate>%(pdate)s</pubDate>
<link>%(link)s</link>
<description>%(desc)s</description>
""" % {
'title': escape(title),
+ 'author': author,
'pdate': pdate,
'link': link,
'desc': escape(p.name),