Skip to content
This repository has been archived by the owner on Apr 9, 2018. It is now read-only.

Homecontrol Server: Bindings: [Info Service] News

Robert Morigi-Eades edited this page Mar 24, 2017 · 1 revision

Overview

News information is retrieved from the News API. The articles from selected news publishers are retrieved using "news_sources" value from the Users Configuration file.

Information is requested from the data sources ad hoc to ensure the most up to date news articles are returned to the client. At present, a user is required in the request and no fallback/default "news_sources" lists is used.

Data structure

News information is used in a set data structure within the HomeControl-server and is shared to the requesting clients in the same structure. The python module(s) for retrieving news data from online sources convert the incoming data to suit the required specification.

Example data structure for news is shown below:

{
    "news_articles": {
        "bbc-news": {
            "source_details": {
                "name": "BBC News",
                "description": "Use BBC News for up-to-the-minute news, breaking news, video, audio and feature stories. BBC News provides trusted World and UK news as well as local and regional perspectives. Also entertainment, business, science, technology and health news.",
                "url": "http://www.bbc.co.uk/news",
                "category": "general",
                "logos": {
                    "small": "http://i.newsapi.org/bbc-news-s.png",
                    "medium": "http://i.newsapi.org/bbc-news-m.png",
                    "large": "http://i.newsapi.org/bbc-news-l.png"
                }
            },
            "articles": [
                {
                    "author":"BBC News",
                    "title":"Storm Doris winds reach 94mph as it hits UK",
                    "description":"Parts of the UK are facing travel disruption as Storm Doris brings high winds and some snow.",
                    "url":"http://www.bbc.co.uk/news/uk-39060095",
                    "urlToImage":"http://ichef-1.bbci.co.uk/news/1024/cpsprodpb/CB99/production/_94812125_mediaitem94812123.jpg",
                    "publishedAt":"2017-02-23T11:48:47Z"
                },
                {...}
            ]
        },
        "...": {
            "source_details": {...}
            "articles": [...]
        },
        ...
    }
}

Data Sources

The following data sources are used to retrieve the necessary information:

Clone this wiki locally