4 # A plugin to XMLWriter to output RSS version 1.0.
12 def __init__(self, planet):
17 def __write_item__(self, item):
19 output += '<item rdfAbout="%s">\n' % item.itemURL
20 output += ' <title>%s: %s</title>\n' % (item.blogName, 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 += ' <dc:date>%s</dc:date>\n' % time.strftime('%Y-%m-%dT%H:%M:%S+08:00', time.gmtime(item.itemDate))
32 output += '<rdf:RDF>\n'
33 output += ' xmlns="http://purl.org/rss/1.0/"\n'
34 output += ' xmlns:dc="http://purl.org/dc/elements/1.1/"\n'
35 output += ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n'
36 output += ' <channel>\n'
37 output += ' <title>Planet UCC</title>\n'
38 output += ' <link>http://planet.ucc.asn.au/</link>\n'
39 output += ' <items>\n'
40 output += ' <rdf:Seq>\n'
41 for blog in self.parent.blogs:
42 output += ' <rdf:li rdf:resource="%s" />\n' % blog.feedURL
43 output += ' </rdf:Seq>\n'
44 output += ' </items>\n'
45 output += ' </channel>\n'
46 for date in self.planet:
47 for item in date.items:
48 output += self.__write_item__(item)
50 if itemcount >= self.maxitems:
52 if itemcount >= self.maxitems:
54 output += '</rdf:RDF>'