feed.py 文件源码

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

项目:news 作者: kuc2477 项目源码 文件源码
def parse(self, content):
        """Parses feed content of http response body into multiple
        :class:`news.models.abstract.Readable`s.

        Internally uses :mod:`~feedparser` library to extract entries from the
        response body.

        :param content: Http response body
        :type content: :class:`str`
        :returns: An iterator of parsed readables
        :rtype: An iterator of :class:`news.models.abstract.Readable`

        """
        f = feedparser.parse(content)
        return (Readable(
            author=e.author, title=e.title, content=e.content, url=e.link,
            summary=e.summary, image=f.image) for e in f.entries)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号