No description
Find a file
Tim Hårek Andreassen ffe81b005d
refactor: Make table.New generic
Signed-off-by: Tim Hårek Andreassen <tim@harek.no>
2024-11-25 19:30:34 +01:00
cmd refactor: Make table.New generic 2024-11-25 19:30:34 +01:00
pkg cache: Simplify expires 2024-11-06 16:01:40 +01:00
yr chore: Uncapitalize errors 2024-11-05 18:49:00 +01:00
.build.yml chore: Typo 2024-10-26 19:38:07 +02:00
CONTRIBUTING.md docs: Typos 2024-10-03 19:53:09 +02:00
go.mod refactor: Use my own browser pkg 2024-10-17 19:31:58 +02:00
go.sum refactor: Use my own browser pkg 2024-10-17 19:31:58 +02:00
LICENSE.md chore: Add license 2024-09-29 19:21:46 +02:00
main.go docs: Add docs 2024-10-05 23:40:49 +02:00
Makefile release: v0.0.6 2024-11-13 19:29:13 +01:00
README.md docs: Use latest 2024-10-16 22:08:26 +02:00
screenshot.png docs: Add screenshot 2024-10-11 11:21:51 +02:00

builds.sr.ht status

yr

screenshot

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@latest

Adding more methods in the future. Help is wanted to achieve the best coverage.

Using pre-compiled binary

Select the version you want to install available releases and download it and add it to your bin or something similar.

Example:

wget https://git.sr.ht/~timharek/yr/refs/download/<release>/yr-<version>-linux-amd64.tar.gz
tar xf yr-<version>-linux-amd64.tar.gz
cd yr-<version>
cp yr /usr/local/bin

Usage

# 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

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.