Added proper namespace support
[planet-ucc.git] / RSS1Writer.py
index 83460d3..638047e 100644 (file)
@@ -30,11 +30,19 @@ class RSS1Writer:
        def write(self):
                itemcount       = 0
                output  =       ''
-               output  +=      '<rdf:RDF>\n'
+               output  +=      '<rdf:RDF\n'
+               output  +=      ' xmlns:dc="http://purl.org/dc/elements/1.1/"\n'
+               output  +=      ' xmlns:content="http://purl.org/rss/1.0/modules/content/">\n'
+               output  +=      ' xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">\n'
                output  +=      ' <channel>\n'
                output  +=      '  <title>Planet UCC</title>\n'
                output  +=      '  <link>http://planet.ucc.asn.au/</link>\n'
-               # XXX: we need to output the blogroll here
+               output  +=      '  <items>\n'
+               output  +=      '   <rdf:Seq>\n'
+               for blog in self.parent.blogs:
+                       output  +=      '    <rdf:li rdf:resource="%s" />\n' % blog.feedURL
+               output  +=      '   </rdf:Seq>\n'
+               output  +=      '  <items>\n'
                output  +=      ' </channel>\n'
                for date in self.planet:
                        for item in date.items:

UCC git Repository :: git.ucc.asn.au