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 += ' <guid>%s</guid>\n' % item.itemURL
22 output += ' <link>%s</link>\n' % item.itemURL
23 output += ' <description>\n'
24 output += item.contents
25 output += '\n </description>\n'
26 output += '<pubDate>%s</pubDate>\n' % time.strftime('%a, %d %b %Y %H:%M:%S +0000', time.gmtime(item.itemDate))
33 output += '<rss version="2.0">\n'
34 output += ' <channel>\n'
35 output += ' <title>Planet UCC</title>\n'
36 output += ' <link>http://planet.ucc.asn.au/</link>\n'
37 output += ' <language>en</language>\n'
38 output += ' <description>Planet UCC</description>\n'
39 for date in self.planet:
40 for item in date.items:
41 output += self.__write_item__(item)
43 if itemcount >= self.maxitems:
45 if itemcount >= self.maxitems:
47 output += ' </channel>\n'