Weatherme CLI Tool
github.com
github.com
https://github.com/sramsay/nowa/
(I am also the author of wu, which was a popular cli tool for the Weather Underground API. I had to discontinue that when they closed free access to their API. That was written in Go; this one is written in C).
# Set this:
latlong='33.7737,-118.1365'
url=$(curl -sS "https://api.weather.gov/points/$latlong" | jq -r '.properties.forecastHourly')
curl -sS "$url" | jq -r '.properties | .periods[0].temperature, .generatedAt'
Using Python. import requests
# Set this:
latlong = '33.7737,-118.1365'
session = requests.Session()
url = session.get('https://api.weather.gov/points/' + latlong).json()['properties']['forecastHourly']
f = session.get(url).json()['properties']
print(f['periods'][0]['temperature'])
print(f['generatedAt']) return err if err != nil
everything better than three fucking lines every time something returns err.Especially that some clown decided that apparently
if err != nil { return err }
is too terse and go fmt just goes back to expanding it to 3 lines...Don't get me wrong, error handling is verbose and annoying, but not even displaying actual error is just horrible coding practice.
should be at the very least
err = json.Unmarshal(weatherBody, &WeatherRes)
if err != nil {
fmt.Printf("error decoding weather json: %s\n",err)
return
}
or just be function that returns that error or the weather err = json.Unmarshal(weatherBody, &WeatherRes)
if err != nil {
return fmt.Errorf("error decoding weather json: %s\n",err)
}AnsiWeather is a Shell script for displaying the current weather conditions in your terminal, with support for ANSI colors and Unicode symbols. Weather data comes from the OpenWeatherMap free weather API.
AnsiWeather packages are available for: OpenBSD, NetBSD, FreeBSD, Debian, Ubuntu, Homebrew
https://github.com/fcambus/ansiweather
// Looking for geektool alternative for arm64 w/o Rosetta.
https://github.com/chubin/wttr.in
You gotta love terminal man!
alias weather='f() { curl wttr.in/${1:-sydney} };f' echo yourcity | nc graph.no 79
or finger yourcity@graph.no