In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to browse the weather forecast under the Linux command line". In the daily operation, I believe that many people have doubts about how to browse the weather forecast under the Linux command line. The editor consulted all kinds of materials and sorted out the simple and useful operation methods, hoping to help you answer the doubts about "how to browse the weather forecast under the Linux command line". Next, please follow the editor to study!
Q: I often check the weather forecast on the Linux desktop. However, is there a way to query the weather forecast in a terminal environment without using desktop widgets or browsers?
One of them is wego, a small program under the terminal. Using the ncurses-based interface, this command-line program allows you to view current weather conditions and subsequent forecasts. It also collects weather forecasts for the next five days through a weather forecast API.
Install wego under Linux
Installing wego is fairly simple. Wego is written in Go, and the first step is to install the Go language. Then install wego.
$go get github.com/schachmat/wego
Wego will be installed to $GOPATH/bin, so add $GOPATH/bin to the $PATH environment variable.
$echo'export PATH= "$PATH:$GOPATH/bin" > ~ / .bashrc
$source ~ / .bashrc
Now you can start wego directly from the command line.
$wego
The first time you run weg, you 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. Register and use it free of charge. You only need to provide a valid email address.
Your .wegorc configuration file looks like this:
In addition to API key, you can also configure the place you want to query the weather, the name of the city / country you use, and the language in ~ / .wegorc. Note that the use of API in this weather is limited: up to 5 queries per second and up to 250 queries per day. When you re-execute the wego command, you will see the latest weather forecast (your designated place, of course), as shown in the picture.
The weather information displayed includes: (1) temperature, (2) wind speed and direction, (3) visual distance, and (4) precipitation and precipitation probability display a 3-day weather forecast by default. If you want to modify it, you can change the weather range (up to 5 days) with parameters, such as to view the weather forecast for 5 days:
$wego 5
If you want to check the weather in another place, just provide the name of the city:
$wego Seattle
Problem solving
You may encounter the following error:
User:Currentnot implemented on linux/amd64
This error occurs when you run wego in an environment that does not support native Go compilers. In this case you only need to use gccgo, a compiler front end of Go, to compile the program. This can be done with the following command.
$sudoyum install gcc-go
$go get-compiler=gccgo github.com/schachmat/wego
The above is the method of browsing the weather forecast under the Linux command line. I hope it will be helpful to your study.
At this point, the study on "how to browse the weather forecast under the Linux command line" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.