Adds a news headlines widget

This commit is contained in:
Alicia Sykes
2021-12-19 01:55:46 +00:00
parent 0b868af5bb
commit 8686a99be7
4 changed files with 152 additions and 0 deletions

View File

@@ -17,6 +17,7 @@ Dashy has support for displaying dynamic content in the form of widgets. There a
- [Exchange Rates](#exchange-rates)
- [Stock Price History](#stock-price-history)
- [Joke of the Day](#joke)
- [News Headlines](#news-headlines)
- [Flight Data](#flight-data)
- [NASA APOD](#astronomy-picture-of-the-day)
- [GitHub Trending](#github-trending)
@@ -413,6 +414,34 @@ Renders a programming or generic joke. Data is fetched from the [JokesAPI](https
---
### News Headlines
Displays the latest news, click to read full article. Date is fetched from various news sources using [Currents API](https://currentsapi.services/en)
<p align="center"><img width="380" src="https://i.ibb.co/6NDWW0z/news-headlines.png" /></p>
##### Options
**Field** | **Type** | **Required** | **Description**
--- | --- | --- | ---
**`apiKey`** | `string` | Required | Your API key for CurrentsAPI. This is free, and you can [get one here](https://currentsapi.services/en/register)
**`country`** | `string` | _Optional_ | Fetch news only from a certain country or region. Specified as a country code, e.g. `GB` or `US`. See [here](https://api.currentsapi.services/v1/available/regions) for a list of supported regions
**`category`** | `string` | _Optional_ | Only return news from within a given category, e.g. `sports`, `programming`, `world`, `science`. The [following categories](https://api.currentsapi.services/v1/available/categories) are supported
**`lang`** | `string` | _Optional_ | Specify the language for returned articles as a 2-digit ISO code (limited article support). The [following languages](https://api.currentsapi.services/v1/available/languages) are supported, defaults to `en`
**`count`** | `number` | _Optional_ | Limit the number of results. Can be between `1` and `200`, defaults to `10`
**`keywords`** | `string` | _Optional_ | Only return articles that contain an exact match within their title or description
##### Example
```yaml
- type: news-headlines
options:
apiKey: xxxxxxx
category: world
```
---
### Flight Data
Displays airport departure and arrival flights, using data from [AeroDataBox](https://www.aerodatabox.com/). Useful if you live near an airport and often wonder where the flight overhead is going to. Hover over a row for more flight data.