Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/perbu/yrpoller
Deamon that polls yr.no for data and emits in on 10min basis. Virtual thermometer.
https://github.com/perbu/yrpoller
Last synced: 4 days ago
JSON representation
Deamon that polls yr.no for data and emits in on 10min basis. Virtual thermometer.
- Host: GitHub
- URL: https://github.com/perbu/yrpoller
- Owner: perbu
- License: mit
- Created: 2021-01-15T08:01:14.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-01-28T12:00:20.000Z (almost 4 years ago)
- Last Synced: 2024-11-19T02:03:27.894Z (2 months ago)
- Language: Go
- Size: 3.57 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# yr-poller
Deamon that polls yr.no for data and emits in on 10min basis. Virtual thermometer.## Usage
Create a locations.json file, something like this:
```
[
{
"id": "tryvannstua",
"lat": 59.9981362,
"long": 10.6660856
},
{
"id": "skrindo",
"lat": 60.6605926,
"long": 8.5740604
}
]
```Compile the project:
```
go build -o poller cmd/main.go
```Run it
```
./poller
```It even has some built in help
```
Usage of ./poller:
-api-url string
Baseurl for Yr API (default "https://api.met.no/weatherapi")
-api-version string
API version to use. Appended to URL (default "2.0")
-interval duration
How often to emit data (default 10m0s)
-locationsfile string
JSON file containing locations (default "locations.json")
-user-agent string
User-agent to use (default "yr-poller")
```## Todo
* Remove the mutex stuff and use channels. Initially I wrote this not unlike a Java program with a shared data structure
where I lock/unlock. I've removed most of the access to shared data but the observation cache remains shared.
* Expand of the sensors supported.
* Add tests to the timestream code - possibly painful to mock
* timestream lacks testing
* statushttp lacks testing