4 # A plugin to XMLWriter to output RSS version 1.0.
5 # This plugin has been developed with no regard for the RSS1.0 spec.
13 def __init__(self, planet):
18 def __write_item__(self, item):
20 output += '<item rdfAbout="%s">\n' % item.itemURL
21 output += ' <title>%s: %s</title>\n' % (item.blogTitle, item.itemTitle)
22 output += ' <link>%s</link>\n' % item.itemURL
23 output += ' <content:encoded>\n'
24 output += item.contents
25 output += '\n </content:encoded>\n'
26 output += ' <dc:date>%s</dc:date>\n' % time.strftime('%Y-%m-%dT%H:%M:%S+00:00', time.gmtime(item.itemDate))
32 output = '<rss version="1.0\n'
33 output += ' xmlns:dc="http://purl.org/dc/elements/1.1/"\n'
34 output += ' xmlns:content="http://purl.org/rss/1.0/modules/content/">\n'
35 output += ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n'
36 output += '<rdf:RDF>\n'
37 output += ' <channel>\n'
38 output += ' <title>Planet UCC</title>\n'
39 output += ' <link>http://planet.ucc.asn.au/</link>\n'
40 output += ' <items>\n'
41 output += ' <rdf:Seq>\n'
42 for blog in self.parent.blogs:
43 output += ' <rdf:li rdf:resource="%s" />\n' % blog.feedURL
44 output += ' </rdf:Seq>\n'
45 output += ' <items>\n'
46 output += ' </channel>\n'
47 for date in self.planet:
48 for item in date.items:
49 output += self.__write_item__(item)
51 if itemcount >= self.maxitems:
53 if itemcount >= self.maxitems:
55 output += '</rdf:RDF>\n'