Live data from Hacker News

`curl wttr.in`: Weather in your terminal

github.com

141–147 of 147 posts

Re: `curl wttr.in`: Weather in your terminal

#141

I have to scroll all they way down to the buttom to find the information source -- WorldWeatherOnline. Does people not care about where their whether data is sourced from? Living in Japan, I have always been wary of these type of service, since I find a lot of them really inaccurate. And I just checked, Tokyo show 15C on that website, while high resolution current weather information from Japan Metrological Agency sh…

This is why I like Windy.com. They give you the output directly from the various weather models and you can actually see them all in parallel or just pick whichever one works best for your location.

Living in the PNW where predicting snowfall can be problematic to say the least, I love looking at the various windy.com models. One particular storm, that lead to about an inch of sticking snow this past winter had ranges from 2-20 inches predicted by the various models. The worst part is the 2 inch prediction came from the model that is generally considered the least reliable for our area.

Re: `curl wttr.in`: Weather in your terminal

#142
post #42

In the USA, I like the National Weather Service direct APIs. I wish I could get more granular forecast data, both in time and space, but they forecast dewpoint/humidity, which is really nice.

dewpoint is underrated https://www.weather.gov/arx/why_dewpoint_vs_humidity > less than or equal to 55: dry and comfortable > between 55 and 65: becoming "sticky" with muggy evenings > greater than or equal to 65: lots of moisture in the air, becoming oppressive

Where I live dew point gives a very strong indicator of our overnight low temperatures, especially in winter. Looking at dew point can tell me whether to expect frost or not and if black ice is likely to be an issue in the morning.

But yeah, treating those guidelines as anything other than a loose suggestion is meaningless.

Re: `curl wttr.in`: Weather in your terminal

#143

Earlier quoted context omitted.

> Better not render any graphics! Unironically a good idea. Graphics have always been a mistake - most engineers would agree that if we stuck with very basic output, our software would be in a much better place than today (and more usable, too!)

I don't understand this, how would you create a program to help explore (for example) a 2D coordinate space without any visual aids?

It may be worth evaluating why we need to explore this space through computing in the first place? Pen and paper have never failed us before, nor has actually traveling to the space in question.

Re: `curl wttr.in`: Weather in your terminal

#144
interop done the right way: this guy is going to be in trouble with the web javascript kiddies.

Yes, if this guy is a state-sponsored computer security hacker, he could pown the 3, maybe 4, ppl (and I am one of them) using its http services via curl and our terminals or image format parsers or etc. Is this worth for that many ppl?

Anyways, that's too sexy, I am willing to take the bait.

That said, I could use an official/trusted online source for the weather information and format it myself (I guess I would get a CSV or json or xml file).

Re: `curl wttr.in`: Weather in your terminal

#145

Earlier quoted context omitted.

I don't understand this, how would you create a program to help explore (for example) a 2D coordinate space without any visual aids?

It may be worth evaluating why we need to explore this space through computing in the first place? Pen and paper have never failed us before, nor has actually traveling to the space in question.

generally speaking, computers are faster at performing calculations than humans. this can be beneficial for humans, as if they are able to convert a problem (for example, mapping the densities of functions over a 2D space) into a purely mathematical one, humans are able to save significant time and effort.

Re: `curl wttr.in`: Weather in your terminal

#146
post #42

In the USA, I like the National Weather Service direct APIs. I wish I could get more granular forecast data, both in time and space, but they forecast dewpoint/humidity, which is really nice.

Any links on that? I wrote a set of scripts --- it takes thee , a bash function, sed, and awk --- to parse the dumped formatted HTML to a more usable form on a terminal. Raw APIs might be more convenient / less complicated.

Yes, I am using a handful of different APIs. My full terminal weather setup deserves its own blog post... but until then, here are some zsh snippets, scripts, and curls to get you started.

Rough weather information for next days and hours:

    # Find zone with curl https://api.weather.gov/points/40.5878,-103.0694
    ZONE=${ZONE:-CAZ508}
    echo "Forecast for zone $ZONE"
    curl -s -A MyWeather/1.0 https://api.weather.gov/zones/forecast/$ZONE/forecast \
        | jq -r '.properties.periods[] | [.name, .detailedForecast] | join("\t")' \
        | column -t -s $'\t'

    # Find grid with same curl
    GRID=${GRID:-MTR/93,131}
    echo ""
    echo "Next 24 hours for grid $GRID"
    curl -s -A MyWeather/1.0 https://api.weather.gov/gridpoints/$GRID/forecast/hourly \
        | jq --arg date $(date -Is) -r '.properties.periods[] | select(.startTime >= $date) | [(.startTime), ((.temperature|tostring) + " " + .temperatureUnit), (.windSpeed + " @ " + .windDirection), .shortForecast] | join("\t")' \
        | column -t -s $'\t' \
        | head -n 24

Weather discussion script (also using regexps to parse HTML):

https://gist.github.com/lachesis/6c7e5020b112fe8d7bcc83d99da...

Some docs on the "DWML rest API" that provides the dewpoint/humidity forecasts that I mentioned earlier:

https://graphical.weather.gov/xml/rest.php

https://graphical.weather.gov/xml/DWMLgen/schema/latest_DWML...

https://graphical.weather.gov/xml/docs/elementInputNames.php

Here's the script I use to access that API but it is still under active development and is pretty tailored for my situation. Please forgive jankiness. Give it LAT / LNG environment variables.

https://gist.github.com/lachesis/480a1811c75999205cb17a119b4...

Bonus points, for CA fire season, here's a script that shows PM2.5 for AirNow stations near a certain LAT/LNG:

https://gist.github.com/lachesis/a47212c848430e16e7d1ec6d855...

Re: `curl wttr.in`: Weather in your terminal

#147
in ~ 2016 I built a plugin for on-my-fish to simplify the process of curling wttr.in https://github.com/oh-my-fish/plugin-wttr. From today I'm still using this plugin a lot. Checking out the weather on your terminal turns out to be faster than open a weather website or unlock my phone and check in out a weather app.
Post reply on HN