示例#1
0
def rss(feed):
    if not 'entries' in feed and 'items' in feed:
        feed['entries'] = feed['items']
    now=datetime.datetime.now()
    rss = rss2.RSS2(title = feed.get('title','(notitle)'),
                    link = feed.get('link',None),
                    description = feed.get('description',''),
                    lastBuildDate = feed.get('created_on', now),
                    items = [rss2.RSSItem(
                title=entry.get('title','(notitle)'),
                link=entry('link',None),
                description=entry.get('description',''),
                pubDate=entry.get('created_on', now)
                ) for entry in feed.get('entries',[])])
    return rss2.dumps(rss)
示例#2
0
def rss(feed):
    if not 'entries' in feed and 'items' in feed:
        feed['entries'] = feed['items']
    now = datetime.datetime.now()
    rss = rss2.RSS2(title=str(feed.get('title', '(notitle)')),
                    link=str(feed.get('link', None)),
                    description=str(feed.get('description', '')),
                    lastBuildDate=feed.get('created_on', now),
                    items=[
                        rss2.RSSItem(title=str(entry.get('title',
                                                         '(notitle)')),
                                     link=str(entry.get('link', None)),
                                     description=str(
                                         entry.get('description', '')),
                                     pubDate=entry.get('created_on', now))
                        for entry in feed.get('entries', [])
                    ])
    return rss2.dumps(rss)
示例#3
0
def rss(feed):
    if not 'entries' in feed and 'items' in feed:
        feed['entries'] = feed['items']
    now=datetime.datetime.now()
    rss = rss2.RSS2(title = feed['title'],
                    link = str(feed['link']),
                    description = feed['description'],
                    lastBuildDate = feed.get('created_on', now),
                    items = [rss2.RSSItem(\
                                        title=entry['title'],
                                        link=str(entry['link']),
                                        description=entry['description'],
                                        pubDate=entry.get('created_on', now)
                                        )\
                                    for entry in feed['entries']
                                    ]
                    )
    return rss2.dumps(rss)
示例#4
0
def rss(feed):
    if not 'entries' in feed and 'items' in feed:
        feed['entries'] = feed['items']
    now = datetime.datetime.now()
    rss = rss2.RSS2(title = feed['title'],
                    link = feed['link'],
                    description = feed['description'],
                    lastBuildDate = feed.get('created_on', now),
                    items = [rss2.RSSItem(\
                                        title=entry['title'],
                                        link=entry['link'],
                                        description=entry['description'],
                                        pubDate=entry.get('created_on', now)
                                        )\
                                    for entry in feed['entries']
                                    ]
                    )
    return rss2.dumps(rss)
示例#5
0
def rss(feed):
    if not "entries" in feed and "items" in feed:
        feed["entries"] = feed["items"]
    now = datetime.datetime.now()
    rss = rss2.RSS2(
        title=str(feed.get("title", "(notitle)")),
        link=str(feed.get("link", None)),
        description=str(feed.get("description", "")),
        lastBuildDate=feed.get("created_on", now),
        items=[
            rss2.RSSItem(
                title=str(entry.get("title", "(notitle)")),
                link=str(entry.get("link", None)),
                description=str(entry.get("description", "")),
                pubDate=entry.get("created_on", now),
            )
            for entry in feed.get("entries", [])
        ],
    )
    return rss2.dumps(rss)