MCPcopy Create free account
hub / github.com/geekcomputers/Python / fetch_bbc_news

Function fetch_bbc_news

fetch_news.py:6–11  ·  view source on GitHub ↗
(bbc_news_api_key: str)

Source from the content-addressed store, hash-verified

4
5
6def fetch_bbc_news(bbc_news_api_key: str) -> None:
7 # fetching a list of articles in json format
8 bbc_news_page = requests.get(_NEWS_API + bbc_news_api_key).json()
9 # each article in the list is a dict
10 for news, article in enumerate(bbc_news_page["articles"], 1):
11 print(f"{news}.) {article['title']}")
12
13
14if __name__ == "__main__":

Callers 1

fetch_news.pyFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected