Permalink
Browse files

Include full text of all feeds in the RSS feed.

Create second RSS feed that contains the truncated entries,
like the one before.
  • Loading branch information...
1 parent 149938c commit 83017b427b0c5904f78d4c686ab49d0f5edaaf3f @mhagander committed Nov 3, 2008
Showing with 15 additions and 1 deletion.
  1. +13 −0 generator.py
  2. +2 −1 template/index.tmpl
View
@@ -48,6 +48,12 @@ def Generate(self):
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')
@@ -61,6 +67,12 @@ def Generate(self):
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]),
+ pubDate=post[2],
description=desc))
self.items.append(PlanetPost(post[0], post[1], post[2], post[3], post[5], post[6], desc))
@@ -69,6 +81,7 @@ def Generate(self):
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:
View
@@ -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>

0 comments on commit 83017b4

Please sign in to comment.