コード例 #1
0
ファイル: rss2html.py プロジェクト: Ricky-Wilson/rss2html
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
ファイル: rss2html.py プロジェクト: Ricky-Wilson/rss2html
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
ファイル: test1.py プロジェクト: Ricky-Wilson/rss2html
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
ファイル: test1.py プロジェクト: Ricky-Wilson/rss2html
def convert_feed(**kwargs):
    """ Main loop """
    out = u"\n".join(entry2html(**entry) for entry in parsefeed(kwargs["url"]).entries)
    return out.encode("utf-8")