New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

github.com/cshep4/news-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/cshep4/news-api

v0.0.0-20210505205029-53bc09607a37
Source
Go
Version published
Created
Source

News API

News feed service written in Go which can retrieve news articles from various providers for specified categories.

The REST API for the news retriever is described below.

Env Variables

BBC_URL=http://feeds.bbci.co.uk/news
SKY_URL=http://feeds.skynews.com/feeds

Get Feed

Request

GET /

curl --location --request GET 'localhost:8080?provider=bbc&limit=56&offset=3'

Response

{
    "provider": "bbc",
    "items": [
        {
            "category": "uk",
            "provider": "bbc",
            "title": "Covid vaccinations: Wales leads the UK on first vaccine dose rate",
            "link": "https://www.bbc.co.uk/news/uk-wales-55855220",
            "description": "More than 550,000 people in the top priority groups have been given first doses of Covid vaccines.",
            "thumbnail": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
            "pubDate": "2021-02-06T20:47:21Z"
        }
    ],
    "limit": 1
}

Get Feed by Category

Request

GET /{category}

curl --location --request GET 'localhost:8080/uk?provider=bbc&limit=56&offset=3'

Response

{
    "category": "uk",
    "provider": "bbc",
    "items": [
        {
            "category": "uk",
            "provider": "bbc",
            "title": "Covid vaccinations: Wales leads the UK on first vaccine dose rate",
            "link": "https://www.bbc.co.uk/news/uk-wales-55855220",
            "description": "More than 550,000 people in the top priority groups have been given first doses of Covid vaccines.",
            "thumbnail": "https://news.bbcimg.co.uk/nol/shared/img/bbc_news_120x60.gif",
            "pubDate": "2021-02-06T20:47:21Z"
        }
    ],
    "limit": 1
}

FAQs

Package last updated on 05 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts