feedscanner.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:iitb-blog-aggregator 作者: ranveeraggarwal 项目源码 文件源码
def feeds(page_url):
    """Search the given URL for possible feeds, returning a list of them."""

    # If the URL is a feed, there's no need to scan it for links.
    if is_feed(page_url):
        return [page_url]

    data = fetch_url(page_url)
    parser = FeedFinder(page_url)
    try:
        parser.feed(data)
    except HTMLParser.HTMLParseError:
        pass
    found = parser.urls()

    # Return only feeds that feedparser can understand.
    return [feed for feed in found if is_feed(feed)]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号