112ba8795d
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
68 lines
1.5 KiB
Markdown
68 lines
1.5 KiB
Markdown
[![builds.sr.ht status](https://builds.sr.ht/~timharek/yr/commits/main/.build.yml.svg)](https://builds.sr.ht/~timharek/yr/commits/main/.build.yml?)
|
|
|
|
# [yr]
|
|
|
|
Get the weather delivered to your command-line, or use as a Go package.
|
|
|
|
The project uses [Meteorologisk institutt]'s public API, [`LocationForecast`],
|
|
and [OpenStreetMap]'s [Nominatim] API.
|
|
|
|
## Install CLI
|
|
|
|
Using go: `go install git.sr.ht/~timharek/yr`
|
|
|
|
Adding more methods in the future. Help is wanted to achieve the best coverage.
|
|
|
|
## Usage
|
|
|
|
```bash
|
|
# Get help
|
|
yr --help
|
|
|
|
# Current forecast for location
|
|
yr now bergen
|
|
|
|
# Or with a space
|
|
yr now "new york"
|
|
|
|
# Forecast for multiple hours
|
|
yr forecast "new york"
|
|
|
|
# Forecast for next 5 hours
|
|
yr forecast "new york" -i 5
|
|
|
|
# Open forecast in your web browser
|
|
yr forecast "new york" --web
|
|
|
|
# Open now in your web browser
|
|
yr now "new york" --web
|
|
```
|
|
|
|
### As a package
|
|
|
|
```go
|
|
import "git.sr.ht/~timharek/yr/yr"
|
|
|
|
func weather() {
|
|
y := yr.New()
|
|
|
|
now := y.Now("bergen")
|
|
|
|
// Use the data
|
|
}
|
|
```
|
|
|
|
## Contributing
|
|
|
|
Anyone can contribute to [yr]. Please refer to the [contribution guidelines].
|
|
|
|
Send patches to the [mailing list], report bugs on the [issue tracker].
|
|
|
|
[yr]: https://sr.ht/~timharek/yr/
|
|
[Meteorologisk institutt]: https://www.met.no/
|
|
[`LocationForecast`]: https://api.met.no/weatherapi/locationforecast/2.0/documentation
|
|
[OpenStreetMap]: https://www.openstreetmap.org/
|
|
[Nominatim]: https://nominatim.org/
|
|
[mailing list]: https://lists.sr.ht/~timharek/yr
|
|
[issue tracker]: https://todo.sr.ht/~timharek/yr
|
|
[contribution guidelines]: ./CONTRIBUTING.md
|