Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73199 - website/public_html/beta/site-tools/boost_site
From: dnljms_at_[hidden]
Date: 2011-07-17 15:31:24

Author: danieljames
Date: 2011-07-17 15:31:23 EDT (Sun, 17 Jul 2011)
New Revision: 73199

Website: Fix RSS generation.

Previously items would only be added to RSS feeds as they were
generated, but now they are sometimes add later on. This wasn't working
because items were only pulled from their own feed or the newly
generated page. Now pool all the feed together so the items can be
pulled from other feeds. This is pretty dodgy, so it will probably be
better to store all the items separately. The newly added guids and
links could help here, so it might be worth waiting for the number of
entries without guids to decrease (might remove items to help that
Text files modified:
   website/public_html/beta/site-tools/boost_site/ | 10 ++++++++--
   1 files changed, 8 insertions(+), 2 deletions(-)

Modified: website/public_html/beta/site-tools/boost_site/
--- website/public_html/beta/site-tools/boost_site/ (original)
+++ website/public_html/beta/site-tools/boost_site/ 2011-07-17 15:31:23 EDT (Sun, 17 Jul 2011)
@@ -55,11 +55,15 @@
     # Generate RSS feeds
     if not refresh:
+ old_rss_items_doc = xml.dom.minidom.parseString('''<items></items>''')
+ old_rss_items = {}
+ for feed_file in settings['feeds']:
+ old_rss_items.update(pages.load_rss(feed_file, old_rss_items_doc))
         for feed_file in settings['feeds']:
             feed_data = settings['feeds'][feed_file]
             rss_feed = generate_rss_feed(feed_file, feed_data)
             rss_channel = rss_feed.getElementsByTagName('channel')[0]
- old_rss_items = pages.load_rss(feed_file, rss_feed)
             feed_pages = pages.match_pages(feed_data['matches'])
             if 'count' in feed_data:
@@ -71,7 +75,9 @@
                 elif qbk_page.qbk_file in old_rss_items:
- rss_channel.appendChild(old_rss_items[qbk_page.qbk_file]['item'])
+ rss_channel.appendChild(
+ rss_feed.importNode(
+ old_rss_items[qbk_page.qbk_file]['item'], True))
                     print "Missing entry for %s" % qbk_page.qbk_file

Boost-Commit list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at