How to browse the weather forecast under the Linux command line

Source: Internet
Author: User
Tags valid email address

Q: I often look at the weather forecast on the Linux desktop. However, is there a way in the terminal environment, not through the desktop widget or browser to query the weather forecast?

One of them is WeGo, a small program under a terminal. Using the Ncurses interface, this command-line program allows you to view current weather conditions and subsequent forecasts. It also collects weather forecasts for the next 5 days through a weather-forecast API.

Install the WeGo under Linux

Installing WeGo is fairly straightforward. WeGo is written with go, and the first step is to install the go language. Then install the WeGo.

$ go Get Github.com/schachmat/wego

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

$ Echo ' Export path= ' $PATH: $GOPATH/bin "' >>~/.BASHRC
$ source ~/.BASHRC

You can now start WeGo directly from the command line.

$ wego

The first run of WEG generates 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.


Your. WEGORC configuration file looks like this:

In addition to the API key, you can also configure the location of the weather, the city/country name and language you want to search for in ~/.wegorc. Note that the use of this weather API is limited: up to 5 queries per second, up to 250 times a day. When you re executing the WeGo command, you will see the latest weather forecast (of course, your designated place), as shown in the picture.

The weather information displayed includes: (1) temperature, (2) wind speed and wind direction, (3) visual distance, (4) precipitation and precipitation probability the weather forecast for 3 days will be displayed by default. If you want to make changes, you can change the weather range by parameter (up to 5 days), such as to view the 5-day weather forecast:

$ wego 5

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

$ wego Seattle

Problem solving

You may experience the following error:

User:currentnot implemented on LINUX/AMD64

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 gccgo--a go compiler front-end to compile the program. This step can be accomplished by following the command.

$ Sudoyum Install Gcc-go
$ go get-compiler=gccgo github.com/schachmat/wego

The above is the way to browse the weather forecast under the Linux command line, hope to be helpful to everybody's study.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.