Hassie.NET.API.NewsAPI 2.1.0

A simple to use async library to retrieve news from News API; written in .NET Standard 1.1.

There is a newer version of this package available.
See the version list below for details.
Install-Package Hassie.NET.API.NewsAPI -Version 2.1.0
dotnet add package Hassie.NET.API.NewsAPI --version 2.1.0
<PackageReference Include="Hassie.NET.API.NewsAPI" Version="2.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Hassie.NET.API.NewsAPI --version 2.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

NewsAPI.NET

Build Status

NewsAPI.NET is a asynchronous API wrapper around News API. It is based on their new v2 API and is a work in progress. At the moment, the top headlines and news sources endpoint has been implemented.
It is written in NET Standard 1.1.

NuGet

This library is available on NuGet, under the package name Hassie.NET.API.NewsAPI. The current version is 2.1.0.

Example usage

INewsClient newsClient = new ClientBuilder()
    {
        ApiKey = "Your API Key";
    }
	.Build();

INewsArticles newsArticles = await newsClient.GetTopHeadlines(new TopHeadlinesBuilder()
	.WithCountryQuery(Country.GB)
	.WithLanguageQuery(Language.EN)
	.WithSourcesQuery(Source.BBC_NEWS, Source.BBC_SPORT)
	.Build());

foreach (INewsArticle article in newsArticles)
{
	Console.WriteLine(article.Author);
	Console.WriteLine(article.Description);
	Console.WriteLine(article.ImageURL);
	Console.WriteLine(article.PublishTime);
	Console.WriteLine(article.SourceName);
	Console.WriteLine(article.Title);
	Console.WriteLine(article.URL);
}

License

Copyright ©2018 Hassie.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

NewsAPI.NET

Build Status

NewsAPI.NET is a asynchronous API wrapper around News API. It is based on their new v2 API and is a work in progress. At the moment, the top headlines and news sources endpoint has been implemented.
It is written in NET Standard 1.1.

NuGet

This library is available on NuGet, under the package name Hassie.NET.API.NewsAPI. The current version is 2.1.0.

Example usage

INewsClient newsClient = new ClientBuilder()
    {
        ApiKey = "Your API Key";
    }
	.Build();

INewsArticles newsArticles = await newsClient.GetTopHeadlines(new TopHeadlinesBuilder()
	.WithCountryQuery(Country.GB)
	.WithLanguageQuery(Language.EN)
	.WithSourcesQuery(Source.BBC_NEWS, Source.BBC_SPORT)
	.Build());

foreach (INewsArticle article in newsArticles)
{
	Console.WriteLine(article.Author);
	Console.WriteLine(article.Description);
	Console.WriteLine(article.ImageURL);
	Console.WriteLine(article.PublishTime);
	Console.WriteLine(article.SourceName);
	Console.WriteLine(article.Title);
	Console.WriteLine(article.URL);
}

License

Copyright ©2018 Hassie.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Release Notes

Version 2.1.0
* INewsArticles and INewsSources now return a read only list of INewsArticle and INewsSource respectively, you no longer have to use the Articles/Sources property within the interface to retrieve the list.

Version 2.0.1
* Bug fixes.

Version 2.0.0
* Rewrote API wraper to use builder pattern.
* Implemented Sources endpoint.
* Please refer to documentation to see the updated example usages.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.2.1 294 4/2/2018
2.2.0 307 2/11/2018
2.1.0 273 2/4/2018
2.0.1 230 2/3/2018
2.0.0 269 2/1/2018
1.0.2 258 1/27/2018
1.0.1 291 1/16/2018
1.0.0 327 1/16/2018