git.ucc.asn.au
/
planet-ucc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yet again
[planet-ucc.git]
/
RSS1Writer.py
diff --git
a/RSS1Writer.py
b/RSS1Writer.py
index
83460d3
..
678f98d
100644
(file)
--- a/
RSS1Writer.py
+++ b/
RSS1Writer.py
@@
-2,12
+2,11
@@
# RSS1Writer
#
# A plugin to XMLWriter to output RSS version 1.0.
# RSS1Writer
#
# A plugin to XMLWriter to output RSS version 1.0.
-# This plugin has been developed with no regard for the RSS1.0 spec.
#
# (c) 2004, Davyd Madeley <
[email protected]
>
#
#
# (c) 2004, Davyd Madeley <
[email protected]
>
#
-import time
+import time
, cgi
class RSS1Writer:
def __init__(self, planet):
class RSS1Writer:
def __init__(self, planet):
@@
-20,9
+19,9
@@
class RSS1Writer:
output += '<item rdfAbout="%s">\n' % item.itemURL
output += ' <title>%s: %s</title>\n' % (item.blogTitle, item.itemTitle)
output += ' <link>%s</link>\n' % item.itemURL
output += '<item rdfAbout="%s">\n' % item.itemURL
output += ' <title>%s: %s</title>\n' % (item.blogTitle, item.itemTitle)
output += ' <link>%s</link>\n' % item.itemURL
- output += ' <
content:encoded
>\n'
- output +=
item.contents
- output += '\n </
content:encoded
>\n'
+ output += ' <
description
>\n'
+ output +=
cgi.escape(item.contents)
+ output += '\n </
description
>\n'
output += ' <dc:date>%s</dc:date>\n' % time.strftime('%Y-%m-%dT%H:%M:%S+00:00', time.gmtime(item.itemDate))
output += '</item>\n'
return output
output += ' <dc:date>%s</dc:date>\n' % time.strftime('%Y-%m-%dT%H:%M:%S+00:00', time.gmtime(item.itemDate))
output += '</item>\n'
return output
@@
-31,10
+30,18
@@
class RSS1Writer:
itemcount = 0
output = ''
output += '<rdf:RDF>\n'
itemcount = 0
output = ''
output += '<rdf:RDF>\n'
+ output += ' xmlns="http://purl.org/rss/1.0/"\n'
+ output += ' xmlns:dc="http://purl.org/dc/elements/1.1/"\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'
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:
output += ' </channel>\n'
for date in self.planet:
for item in date.items:
@@
-44,5
+51,5
@@
class RSS1Writer:
break
if itemcount >= self.maxitems:
break
break
if itemcount >= self.maxitems:
break
- output += '</rdf:RDF>
\n
'
+ output += '</rdf:RDF>'
return output
return output
UCC
git Repository :: git.ucc.asn.au