Traditional Culture Encyclopedia - Weather forecast - How to browse the weather forecast under Linux command line

How to browse the weather forecast under Linux command line

Install wego under Linux

Installing wego is quite simple. Wego is written in go, so the first step is to install the Go language. Then install wego.

Go find github.com/schachmat/wego.

Wego will be installed in $GOPATH/bin, so add $GOPATH/bin to the $PATH environment variable.

$ echo ' export PATH = " $ PATH:$ GOPATH/bin " ' & gt; & gt~/.bashrc

$ source ~/。 bashrc

You can now use the.

$ wego

Running weg for the first time will generate a configuration file (~/. Wegorc) and you need to specify a weather API key. You can get a free API key from worldweatheronline.com. Free registration and use. You only need to provide a valid email address.

Yours The wegorc configuration file will look like this:

In addition to API key, you can also configure the location, city/country name and language you want to query the weather in ~/.wegorc. Note that the use of this weather API is limited: it can be queried at most 5 times per second and 250 times per day. When you re-execute the wego command, you will see the latest weather forecast (of course, the place you specified), as shown in the title map.

The displayed weather information includes: (1) temperature, (2) wind speed and direction, (3) visible distance, (4) precipitation and precipitation probability. By default, the weather forecast for three days will be displayed. If you want to modify it, you can change the weather range (up to 5 days) through parameters, such as viewing the weather forecast for 5 days:

$ wego 5

If you want to check the weather in another place, just provide the city name:

$ TERM Wego Seattle

problem solving

You may encounter the following error:

This error occurs when you run Wego in an environment that does not support the native Go compiler. In this case, you only need to use gcc Go, a compiler front end of go, to compile the program. This step can be completed by the following command.

$ sudoyum installs gcc-go.

$ go get-compiler = gcc go github.com/schachmat/wego

User: currently not implemented on linux/amd64.