BBCHeadlines

BBCHeadlines-从BBC获取新闻的python包。-Aarav Borthakur

发布:2020-12-22 20:27:54.811252

作者:Aarav Borthakur

### 作者邮箱:gadhaguy13@gmail.com

### 首页:https://github.com/gadhagod/BBCHeadlines

### 文档:None

### 下载链接 

# BBCNews

A python package to get news from BBC.

Installation

pip3 install BBCHeadlines

Usage

Get all top articles of right now:

from BBCHeadlines import news
print(news())

Get the top article:

print(news(limit=1))

Sample response:

[
    {
        "title":"US election: Trump campaign seeks partial recount in Wisconsin",
        "title_detail":{
            "type":"text/plain",
            "language":"None",
            "base":"http://feeds.bbci.co.uk/news/world/rss.xml",
            "value":"US election: Trump campaign seeks partial recount in Wisconsin"
        },
        "summary":"Two counties will be asked to recount votes as Donald Trump continues to contest the election result.",
        "summary_detail":{
            "type":"text/html",
            "language":"None",
            "base":"http://feeds.bbci.co.uk/news/world/rss.xml",
            "value":"Two counties will be asked to recount votes as Donald Trump continues to contest the election result."
        },
        "links":[
            {
                "rel":"alternate",
                "type":"text/html",
                "href":"https://www.bbc.co.uk/news/world-us-canada-54994212"
            }
        ],
        "link":"https://www.bbc.co.uk/news/world-us-canada-54994212",
        "id":"https://www.bbc.co.uk/news/world-us-canada-54994212",
        "guidislink":False,
        "published":"Wed, 18 Nov 2020 18:40:53 GMT",
        "published_parsed":time.struct_time(tm_year=2020,
        tm_mon=11,
        tm_mday=18,
        tm_hour=18,
        tm_min=40,
        tm_sec=53,
        tm_wday=2,
        tm_yday=323,
        tm_isdst=0)
    }
]




 Copy from pypi.org

查询时间:6.633ms

渲染时间:6.758ms

本文同步分享在 博客“zhenruyan”(other)。
如有侵权,请联系 support@oschina.cn 删除。
本文参与“OSC源创计划”,欢迎正在阅读的你也加入,一起分享。

评论

暂无评论