Science and technology

Use this open supply software to get your native climate forecast

Last 12 months, I introduced you 19 days of recent (to you) productiveness instruments for 2019. This 12 months, I am taking a unique method: constructing an surroundings that may mean you can be extra productive within the new 12 months, utilizing instruments you could or might not already be utilizing.

Check the climate with wego

One of the issues I really like in regards to the previous decade of my employment is that it largely has been distant. I can work wherever I occur to be on the earth, though the fact is that I spend plenty of time in my house workplace. The draw back is that once I go away the home, I base plenty of selections on what the circumstances appear like exterior my window. And the place I stay, “sunny and clear” can imply something from “scorchingly hot” to “below freezing” to “it will rain in an hour.” Being capable of test the precise circumstances and forecast rapidly is fairly helpful.

Wego is a program written in Go that may fetch and show your native climate. It even renders it in shiny ASCII artwork if you want.

To set up wego, you’ll want to be sure Go is put in in your system. After that, you possibly can fetch the most recent model with the go get command. You’ll most likely wish to add the ~/go/bin listing to your path as effectively:

go get -u github.com/schachmat/wego
export PATH=~/go/bin:$PATH
wego

On its first run, wego will complain about lacking API keys. Now you’ll want to resolve on a backend. The default backend is for Forecast.io, which is a part of Dark Sky. Wego additionally helps OpenWeatherMap and WorldWeatherOnline. I desire OpenWeatherMap, so that is what I am going to present you the way to arrange right here.

You’ll have to register for an API key with OpenWeatherMap. Registration is free, though the free API key has a restrict on what number of queries you may make in a day; this ought to be wonderful for a mean consumer. Once you will have your API key, put it into the ~/.wegorc file. Now can also be time to fill in your location, language, and whether or not you utilize metric, imperial (US/UK), metric-ms, or International System of Units (SI). OpenWeatherMap helps areas by identify, postal code, coordinates, and ID, which is without doubt one of the causes I prefer it.

# wego configuration for OEM
aat-coords=false
aat-monochrome=false
backend=openweathermap
days=three
forecast-lang=en
frontend=ascii-art-table
jsn-no-indent=false
location=Pittsboro
owm-api-key=XXXXXXXXXXXXXXXXXXXXX
owm-debug=false
owm-lang=en
items=imperial

Now, working wego on the command line will present the native climate for the subsequent three days.

Wego also can present information as JSON output for consumption by applications and with emoji. You can select a frontend with the -f command-line parameter or within the .wegorc file.

If you wish to see the climate each time you open a brand new shell or log into a bunch, merely add wego to your ~/.bashrc (or ~/.zshrc in my case).

The wttr.in undertaking is a web-based wrapper round wego. It supplies some extra show choices and is offered on the web site of the identical identify. One cool factor about wttr.in is you could fetch one-line details about the climate with curl. I’ve just a little shell perform known as get_wttr that fetches the present forecast in a shortened type.

get_wttr()

Now, earlier than I go away the home, I’ve a fast and straightforward strategy to discover out if I want a coat, an umbrella, or sunscreen—straight from the command line the place I spend most of my time.

Most Popular

To Top