Include full text of all feeds in the RSS feed.
authorMagnus Hagander <magnus@hagander.net>
Mon, 3 Nov 2008 14:21:31 +0000 (14:21 +0000)
committerMagnus Hagander <magnus@hagander.net>
Mon, 3 Nov 2008 14:21:31 +0000 (14:21 +0000)
Create second RSS feed that contains the truncated entries,
like the one before.

generator.py
template/index.tmpl

index a895d2bbf20c4ec4186a2050004c1bab2f977dca..0e46d3c23696002a9bae60b73af0d7d5daf5beea 100755 (executable)
@@ -48,6 +48,12 @@ class Generator:
                        description = 'Planet PostgreSQL',
                        generator = 'Planet PostgreSQL',
                        lastBuildDate = datetime.datetime.utcnow())
+               rssshort = PyRSS2Gen.RSS2(
+                       title = 'Planet PostgreSQL (short)',
+                       link = 'http://planet.postgresql.org',
+                       description = 'Planet PostgreSQL (short)',
+                       generator = 'Planet PostgreSQL',
+                       lastBuildDate = datetime.datetime.utcnow())
 
                psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
                self.db.set_client_encoding('UTF8')
@@ -57,6 +63,12 @@ class Generator:
                for post in c.fetchall():
                        desc = self.TruncateAndCleanDescription(post[4])
                        rss.items.append(PyRSS2Gen.RSSItem(
+                               title=post[5] + ': ' + post[3],
+                               link=post[1],
+                               guid=PyRSS2Gen.Guid(post[0],post[7]),
+                               pubDate=post[2],
+                               description=post[4]))
+                       rssshort.items.append(PyRSS2Gen.RSSItem(
                                title=post[5] + ': ' + post[3],
                                link=post[1],
                                guid=PyRSS2Gen.Guid(post[0],post[7]),
@@ -69,6 +81,7 @@ class Generator:
                        self.feeds.append(PlanetFeed(feed[0], feed[1], feed[2]))
 
                rss.write_xml(open("www/rss20.xml","w"), encoding='utf-8')
+               rssshort.write_xml(open("www/rss20_short.xml","w"), encoding='utf-8')
 
                self.WriteFromTemplate('index.tmpl', 'www/index.html')
                for staticfile in self.staticfiles:
index 3d80283ee1bcc17a1c523465fa0b0e1e683f99b0..a9da1fd1ad4757dab91d464a79d7d1403f1fedf6 100644 (file)
@@ -9,7 +9,8 @@
      </ul>
      <div class="planetRightTitle">Feeds</div>
      <ul>
-      <li><a href="rss20.xml"><img src="img/feed-icon-14x14.png" alt="rss" /></a> <a href="rss20.xml">Planet PostgreSQL</a></li>
+      <li><a href="rss20.xml"><img src="img/feed-icon-14x14.png" alt="rss" /></a> <a href="rss20.xml">All feeds (full entries)</a></li>
+      <li><a href="rss20_short.xml"><img src="img/feed-icon-14x14.png" alt="rss" /></a> <a href="rss20_short.xml">All feeds (short entries)</a></li>
      </ul>
      <div class="planetRightTitle">Planet</div>
      <p><a href="policy.html">Policy</a> for being listed on Planet PostgreSQL</p>