Committed at the Behesh of Frenchie, I haven't been keeping a good changelog
authordavyd <davyd>
Fri, 26 Nov 2004 04:00:05 +0000 (04:00 +0000)
committerdavyd <davyd>
Fri, 26 Nov 2004 04:00:05 +0000 (04:00 +0000)
RSS2Writer.py
XHTMLWriter.py
XMLParse2.py
XMLWriter.py
feedlist
sidebar.html
update-planet

index cd19d11..2a6ee02 100644 (file)
@@ -23,6 +23,7 @@ class RSS2Writer:
                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
        
index 99300ba..caa01f3 100644 (file)
@@ -27,6 +27,8 @@ class XHTMLWriter:
                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
        
@@ -40,6 +42,9 @@ class XHTMLWriter:
                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'
@@ -90,7 +95,8 @@ class XHTMLWriter:
                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
index d1ca814..978b418 100644 (file)
@@ -31,6 +31,7 @@ class BlogItem:
                self.itemTitle  = None
                self.itemDate   = None
                self.itemURL    = None
+               self.commentsURL = None
                self.contents   = None
 
 class XMLParse:
@@ -86,6 +87,10 @@ 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'):
@@ -96,13 +101,16 @@ class XMLParse:
                                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
index a4bca9d..27f4738 100644 (file)
@@ -19,6 +19,7 @@ class PlanetItem:
                self.imageURL   = blog.imageURL
                self.imageLink  = blog.imageLink
                self.contents   = item.contents
+               self.commentsURL = item.commentsURL
 
 class PlanetDate:
        def __init__(self, date):
index 1d4c289..4446675 100644 (file)
--- a/feedlist
+++ b/feedlist
@@ -34,7 +34,6 @@ Rob Slaughter         http://www.livejournal.com/users/robthesilent/data/rss
 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
@@ -59,5 +58,7 @@ Thomas Pope           http://www.livejournal.com/users/tomtim/data/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
index 9ceb2a2..8c71c60 100644 (file)
  the <a href="mailto:[email protected]">Planet Master</a>.
 </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;">
+ &nbsp;<a href="rss1.xml"><img src="rss10.png" alt="RSS 1.0" title="RSS 1.0 Feed"/></a>&nbsp;
+ <a href="rss2.xml"><img src="rss20.png" alt="RSS 2.0" title="RSS 2.0 Feed" /></a><br />
+ &nbsp;<a href="foaf.xml"><img src="foaf.png" alt="FOAF" title="Friend of a Friend (FOAF) Feed" /></a>&nbsp;
+ <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;">
+ &nbsp;<img src="glider.png" alt="Hacking Life" title="Hacking Life" />&nbsp;
+ &nbsp;<a href="http://www.ucc.asn.au"/><img src="ucc-sun-logo-black.png" alt="UCC" title="University Computer Club" /></a>&nbsp;
 </p>
index 6beba5e..7f31e52 100755 (executable)
@@ -55,6 +55,7 @@ try:
        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))
@@ -75,7 +76,7 @@ try:
        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')

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