bin/make-rss-feed.py
def build_blog_rss(config, filename, all_posts):
    '''
    Generate RSS2 feed.xml file for blog given the metadata blobs for
    recent posts.
    '''

    # Fill in rendered content and excerpt.
    for p in all_posts:
        p['content'], p['excerpt'] = get_blog_content_excerpt(config, p['path'])

    # Create RSS items.
    site = config['site']
    items = [ContentEncodedRSSItem(title=p['title'],
                                   creator=p['author'],
                                   link=os.path.join(site, p['path']),
                                   description=p['excerpt'],
                                   content=p['content'],
                                   pubDate=datetime.datetime.fromordinal(
                                     p['date'].toordinal()))
             for p in all_posts]

    # Create RSS feed.
    rss = ContentEncodedRSS2(title=config['blog_title'],
                             description=config['blog_subtitle'],
                             lastBuildDate=datetime.datetime.utcnow(),
                             link=site,
                             items=items)

    # Save.
    with open(filename, 'w') as writer:
        rss.write_xml(writer)

    Generate RSS2 feed.xml file for blog given the metadata blobs for
    recent posts.
    
Generate RSS2 feed.xml file for blog given the metadata blobs for
recent posts.
Generate RSS2 feed . xml file for blog given the metadata blobs for recent posts .
def build_blog_rss(config, filename, all_posts):
    for p in all_posts:
        p['content'], p['excerpt'] = get_blog_content_excerpt(config, p['path'])
    site = config['site']
    items = [ContentEncodedRSSItem(title=p['title'],
                                   creator=p['author'],
                                   link=os.path.join(site, p['path']),
                                   description=p['excerpt'],
                                   content=p['content'],
                                   pubDate=datetime.datetime.fromordinal(
                                     p['date'].toordinal()))
             for p in all_posts]
    rss = ContentEncodedRSS2(title=config['blog_title'],
                             description=config['blog_subtitle'],
                             lastBuildDate=datetime.datetime.utcnow(),
                             link=site,
                             items=items)
    with open(filename, 'w') as writer:
        rss.write_xml(writer)
def build_blog_rss ( config , filename , all_posts ) : for p in all_posts : p [ 'content' ] , p [ 'excerpt' ] = get_blog_content_excerpt ( config , p [ 'path' ] ) site = config [ 'site' ] items = [ ContentEncodedRSSItem ( title = p [ 'title' ] , creator = p [ 'author' ] , link = os . path . join ( site , p [ 'path' ] ) , description = p [ 'excerpt' ] , content = p [ 'content' ] , pubDate = datetime . datetime . fromordinal ( p [ 'date' ] . toordinal ( ) ) ) for p in all_posts ] rss = ContentEncodedRSS2 ( title = config [ 'blog_title' ] , description = config [ 'blog_subtitle' ] , lastBuildDate = datetime . datetime . utcnow ( ) , link = site , items = items ) with open ( filename , 'w' ) as writer : rss . write_xml ( writer )
Generate RSS2 feed.xml file for blog given the metadata blobs for
recent posts.
Generate RSS2 feed . xml file for blog given the metadata blobs for recent posts .
'''
    Generate RSS2 feed.xml file for blog given the metadata blobs for
    recent posts.
    ''' # Fill in rendered content and excerpt. # Create RSS items. # Create RSS feed. # Save.
config
filename
all_posts