Пример #1
0
def convert_feed(**kwargs):
    """ Convert a single rss feed to html """
    out = StringIO.StringIO("")
    url = kwargs['url']
    tmp = parsefeed(url)
    feed = tmp.feed
    entries = tmp.entries
    print >>out, feedinfo(title=feed.title,
                        description=feed.description,
                        date=feed.date)

    for entry in entries:
        print >>out, entry2html(title=entry.title,
                                link=entry.link,
                                description=entry.description)
    return out.getvalue()
Пример #2
0
def convert_feed(**kwargs):
    """
    convert_feed(url='http://stackoverflow.com/feeds')
    """
    out = StringIO.StringIO("")
    url = kwargs['url']
    tmp = parsefeed(url)
    feed = tmp.feed
    entries = tmp.entries
    print >> out, meta2html(title=feed.title,
                            description=feed.description,
                            date=feed.date)

    for entry in entries:
        print >> out, entry2html(title=entry.title,
                                 link=entry.link,
                                 description=entry.description)
    return out.getvalue()
Пример #3
0
def convert_feed(**kwargs):
    """
    convert_feed(url='http://stackoverflow.com/feeds')
    """
    out = StringIO.StringIO("")
    url = kwargs['url']
    tmp = parsefeed(url)
    feed = tmp.feed
    entries = tmp.entries
    print >>out, meta2html(title=feed.title,
                        description=feed.description,
                        date=feed.date)

    for entry in entries:
        print >>out, entry2html(title=entry.title,
                                link=entry.link,
                                description=entry.description)
    return out.getvalue()
Пример #4
0
def convert_feed(**kwargs):
    """ Main loop """
    out = u'\n'.join(
        entry2html(**entry) for entry in parsefeed(kwargs['url']).entries)
    return out.encode('utf-8')
Пример #5
0
def convert_feed(**kwargs):
    """ Main loop """
    out = u"\n".join(entry2html(**entry) for entry in parsefeed(kwargs["url"]).entries)
    return out.encode("utf-8")