4 # A plugin to XMLWriter to output RSS2.
12 def __init__(self, planet):
17 def __write_item__(self, item):
20 output += ' <title>%s: %s</title>\n' % (item.blogTitle, item.itemTitle)
21 output += ' <link>%s</link>\n' % item.itemURL
22 output += ' <description>\n'
23 output += cgi.escape(item.contents)
24 output += '\n </description>\n'
25 output += '<pubDate>%s</pubDate>\n' % time.strftime('%a, %d %b %Y %H:%M:%S +0800', time.gmtime(item.itemDate))
32 output += '<rss version="2.0">\n'
33 output += ' <channel>\n'
34 output += ' <title>Planet UCC</title>\n'
35 output += ' <link>http://planet.ucc.asn.au/</link>\n'
36 output += ' <language>en</language>\n'
37 output += ' <description>Planet UCC</description>\n'
38 for date in self.planet:
39 for item in date.items:
40 output += self.__write_item__(item)
42 if itemcount >= self.maxitems:
44 if itemcount >= self.maxitems:
46 output += ' </channel>\n'