output += cgi.escape(item.contents)
output += '\n </description>\n'
output += '<pubDate>%s</pubDate>\n' % time.strftime('%a, %d %b %Y %H:%M:%S +0800', time.gmtime(item.itemDate))
+ output += '<comments>%s</comments>\n' % item.commentsURL
output += '</item>\n'
return output
output += '<div class="itembody">\n'
output += item.contents
output += '\n</div>\n'
+ if item.commentsURL:
+ output += '<p class="comments"><a href="%s">Comments</a></p>' % item.commentsURL
output += '</div>\n'
return output
output += '<title>Planet UCC</title>\n'
output += '<link rel="stylesheet" href="planet.css" type="text/css" media="screen" />\n'
output += '<link rel="icon" type="image/png" href="icon.png" />\n'
+ output += '<link rel="SHORTCUT ICON" type="image/png" href="icon.png" />\n'
+ output += '<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="rss1.xml" />\n'
+ output += '<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="rss2.xml" />\n'
output += '</head>\n'
output += '<body>\n'
output += '<div class="header">\n'
return output
def __blog_sort__(self, blog1, blog2):
- name1, name2 = blog1.blogName.split(' ')[-1], blog2.blogName.split(' ')[-1]
+ # name1, name2 = blog1.blogName.split(' ')[-1], blog2.blogName.split(' ')[-1]
+ name1, name2 = blog1.blogName, blog2.blogName
if name1 < name2: return -1
if name1 == name2: return 0
if name1 > name2: return 1
self.itemTitle = None
self.itemDate = None
self.itemURL = None
+ self.commentsURL = None
self.contents = None
class XMLParse:
item.blogURL = data['channel']['link']
else:
item.blogURL = self.feedURL
+ if data['feed'].has_key ('image') and data['feed']['image'].has_key ('url'):
+ item.imageURL = data['feed']['image']['url']
+ if data['feed'].has_key ('image') and data['feed']['image'].has_key ('link'):
+ item.imageLink = data['feed']['image']['link']
for entry in data['items']:
blogItem = BlogItem()
if entry.has_key('title'):
blogItem.itemURL = entry['link']
else:
blogItem.itemURL = item.blogURL
- if entry.has_key('date_parsed'):
- blogItem.itemDate = time.mktime(entry['date_parsed']) + 28800
+ if entry.has_key('modified_parsed'):
+ try: blogItem.itemDate = time.mktime(entry['modified_parsed']) + 28800
+ except: blogItem.itemDate = 0
else:
blogItem.itemDate = 0
if entry.has_key('description'):
blogItem.contents = entry['description']
else:
blogItem.contents = '(entry could not be retrieved)'
+ if entry.has_key ('comments'):
+ blogItem.commentsURL = entry['comments']
item.items.append(blogItem)
return item
self.imageURL = blog.imageURL
self.imageLink = blog.imageLink
self.contents = item.contents
+ self.commentsURL = item.commentsURL
class PlanetDate:
def __init__(self, date):
Alex Dawson http://www.livejournal.com/users/theducks/data/rss
Tracey Brown http://www.livejournal.com/users/tazaria/data/rss
Lionel Pryce http://www.livejournal.com/users/jetblackvalias/data/rss
-Carlo Andreacchio http://www.livejournal.com/users/the_icon_of_sin/data/rss
Rohan Joyce http://www.livejournal.com/users/booto/data/rss
Greg Cresp http://www.livejournal.com/users/the_riviera_kid/data/rss
Adrian Woodley http://www.diskworld.com.au/blog/adrian/index.rss
Stephen Griffiths http://www.livejournal.com/users/utopos/data/rss
David Adam http://zanchey.ucc.asn.au/zanchey.rss
Antony N. Lord http://www.livejournal.com/users/antonylord/data/rss
-James French http://www.frenchie.id.au/frenchierss.php
+James French http://frenchie.ucc.asn.au/frenchie.rss
Shay Telfer http://www.earthyself.com/blog/index.rdf
+Oliver Mailes http://www.livejournal.com/users/oliverm/data/rss
+Tim Duheaume http://www.livejournal.com/users/squimmy/data/rss
</p>
<h2>Syndication</h2>
-<p>
- Planet UCC offers
- <a href="rss1.xml">RSS 1.0</a>,
- <a href="rss2.xml">RSS 2.0</a>,
- <a href="foaf.xml">FOAF</a>, and
- <a href="opml.xml">OPML</a>
- feeds of this webpage.
+<p style="text-align: center;">
+ <a href="rss1.xml"><img src="rss10.png" alt="RSS 1.0" title="RSS 1.0 Feed"/></a>
+ <a href="rss2.xml"><img src="rss20.png" alt="RSS 2.0" title="RSS 2.0 Feed" /></a><br />
+ <a href="foaf.xml"><img src="foaf.png" alt="FOAF" title="Friend of a Friend (FOAF) Feed" /></a>
+ <a href="opml.xml"><img src="opml.png" alt="OPML" title="Outline Processor Markup Language (OPML) Feed" /></a>
</p>
-<h2>Links</h2>
-<p>
- <a href="http://www.ucc.asn.au/">UCC Homepage</a>
+<h2></h2>
+<p style="text-align: center;">
+ <img src="glider.png" alt="Hacking Life" title="Hacking Life" />
+ <a href="http://www.ucc.asn.au"/><img src="ucc-sun-logo-black.png" alt="UCC" title="University Computer Club" /></a>
</p>
codecs.open('planet.html', 'wb', 'utf-8').write(xmlwriter.write(XHTMLWriter.XHTMLWriter))
except:
sys.stderr.write('DEBUG: update-planet: could not write planet.html, aborting\n')
+ raise
try:
codecs.open('rss2.xml', 'wb', 'utf-8').write(xmlwriter.write(RSS2Writer.RSS2Writer))
codecs.open('opml.xml', 'wb', 'utf-8').write(xmlwriter.write(OPMLWriter.OPMLWriter))
except:
sys.stderr.write('DEBUG: update-planet: could not write opml.xml, aborting\n')
- raise
+
if not tainted:
sys.stdout.write('PlanetUCC: no objects have changed in the cache, not updating\n')