Feature: add stock market data widget

ran pre-commit hook

improved translations and error handling

include service widget

fix: update docs image

use original spacing in yaml file

fix: typo in docs

use Error component

use regular error messaging here

fix: make use of standard config error

fix: map through data in jsx

fix: simplify parsing/error logic
This commit is contained in:
Dylan Ullrich
2024-06-06 09:06:57 -07:00
parent 810c321881
commit ae3df9eeeb
14 changed files with 424 additions and 1 deletions

View File

@@ -0,0 +1,46 @@
---
title: Stocks
description: Stocks Information Widget Configuration
---
The Stocks Information Widget allows you to include basic stock market data in
your Homepage header. The widget includes the current price of a stock, and the
change in price for the day.
Finnhub.io is currently the only supported provider for the stocks widget.
You can sign up for a free api key at [finnhub.io](https://finnhub.io).
You are encouraged to read finnhub.io's
[terms of service/privacy policy](https://finnhub.io/terms-of-service) before
signing up. The documentation for the endpoint that is utilized can be viewed
[here](https://finnhub.io/docs/api/quote).
You must set `finnhub` as a provider in your `settings.yaml` like below:
```yaml
providers:
finnhub: yourfinnhubapikeyhere
```
Next, configure the stocks widget in your `widgets.yaml`:
The information widget allows for up to 8 items in the watchlist.
```yaml
- stocks:
provider: finnhub
color: true # Optional | default = true
cache: 1 # Optional | Stocks widget default is to cache results for 1 minute
watchlist:
- GME
- AMC
- NVDA
- AMD
- TSM
- MSFT
- AAPL
- BRK.A
```
The above configuration would result in something like this:
![Example of Stocks Widget](../../assets/widget_stocks_demo.png)