|
| 1 | +NewsAPI.NET |
| 2 | +=========== |
| 3 | +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, only the top headlines endpoint has been implemented. |
| 4 | +It is written in NET Standard 1.1. |
| 5 | + |
| 6 | +NuGet |
| 7 | +----- |
| 8 | +This library is available on NuGet, under the package name Hassie.NET.API.NewsAPI. The current version is 1.0.1. |
| 9 | + |
| 10 | +Example usage |
| 11 | +------------- |
| 12 | +```cs |
| 13 | +INewsClient newsClient = new ClientBuilder() |
| 14 | + { |
| 15 | + ApiKey = "Your API Key"; |
| 16 | + }; |
| 17 | +INewsArticles articles = await newsClient.GetTopHeadlines(Category.TECHNOLOGY, Country.GB); |
| 18 | +INewsArticle article = articles.Articles.ElementAt(4); |
| 19 | +Console.WriteLine(article.Author); |
| 20 | +Console.WriteLine(article.Description); |
| 21 | +Console.WriteLine(article.ImageURL); |
| 22 | +Console.WriteLine(article.PublishTime); |
| 23 | +Console.WriteLine(article.SourceName); |
| 24 | +Console.WriteLine(article.Title); |
| 25 | +Console.WriteLine(article.URL); |
| 26 | +``` |
| 27 | + |
| 28 | +License |
| 29 | +------- |
| 30 | +Copyright ©2018 Hassie. |
| 31 | + |
| 32 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 33 | +you may not use this file except in compliance with the License. |
| 34 | +You may obtain a copy of the License at |
| 35 | + |
| 36 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 37 | + |
| 38 | +Unless required by applicable law or agreed to in writing, software |
| 39 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 40 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 41 | +See the License for the specific language governing permissions and |
| 42 | +limitations under the License. |
0 commit comments