stefansbv / wu

A fast command-line weather app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wu

Version 3.11.5

wu is a small, fast command-line application that retrieves weather data from Weather Underground.

Update (31 December 2018)

Greetings wu users! I use wu every single day, and I try to deal with issues that come up. It isn't updated very often, but mostly because it appears to be bug free and is feature complete.

There have, however, been problems building wu on MacOS using versions of the Go compiler after 1.9. The problem appears to be ultimately related to MacOS itself, but from the standpoint of someone trying to compile from source, it has to do with cgo (the tool used to create Go programs that link to C libraries). If you compile Go without cgo, the problem goes away. However, Go compiled with cgo is the default on most platforms.

I am in the process of rewriting this program in C++ -- in part for fun (I know), but mostly because I think package maintainers will have an easier time with the standard autoconf toolchain. As I do this, I am discovering little bugs here and there and a few things that could be formatted better (particularly for users of the metric system). I am therefore updating this version as I write the new version, and I have no plans to deprecate the Go version in favor of the C++ version.

I realize that a lot of people use wu -- some, for fairly mission-critical purposes. I am writing this update primarily to assure users that this program is still being actively maintained, to acknowledge this hiccup with Go, and to indicate that there may be another (nearly identical) version of the program available soon.

If you have any insight into what is going on with cgo and the crypto/x509 library, I'd love to hear from you. Otherwise, please continue to enjoy wu, report any bugs you see, and experience lovely/interesting weather wherever you are.

Steve

Description

To use wu, you need to obtain an API key from Weather Underground http://www.wunderground.com/weather/api/. You should then add that key, the name of your default weather station, and your preference for Fahrenheit or Celcius (new feature in 3.10!) to $HOME/.condrc. E.g.:

{
  "key": "YOUR_API_KEY",
  "station": "Lincoln, NE",
	"degrees": "F"
}

(the above is available in the wu root directory as "condrc")

wu has the following major options:

  • --conditions reports the current weather conditions.

  • --forecast gives the current (3-day) forecast.

  • --forecast10 gives the current (10-day) forecast.

  • --alerts reports any active weather alerts.

  • --lookup [STATION] allows you to determine the codes for the various weather stations in a particular area. The format for STATION is the same as that for the -s switch below.

  • --astronomy reports sunrise, sunset, and lunar phase.

  • --almanac reports average high and low temperatures, as well as record temperatures for the day.

  • --yesterday gives detailed almanac information for the previous day.

  • --history=YYYYMMDD gives detailed almanac information for a given day.

  • --planner=MMDDMMDD gives averages for travel planning (30-day max).

  • --tides reports tidal data (when available).

  • --all generate all reports (useful for creating custom reports and for mollifying the truly weather-crazed).

All twelve options can be accompanied by the -s switch, which can be used to override the default location in .condrc. The argument passed to -s can be a "city, state-abbreviation/country", a (U.S. or Canadian) zip code, a 3- or 4-letter airport code, or "lat,long".

wu also has two additional switches that provide information about the program:

  • --help
  • --version

By itself, the wu command will show the current conditions.

Compiling and Installing Wu

Mac users can install wu through the Homebrew system by typing:

brew install wu

It can also be compiled from source. Wu is written in the Go programming language (version 1.0 or later). If you don't have a Go compiler, you'll need to install one..

To obtain the source code for wu:

git clone git://github.com/sramsay/wu.git

To compile the wu executable, type:

go build

To compile and install the excutable type:

go install

(this will install it at the location specified by the GOPATH variable).

Wu should work on any system that can compile Go programs.

You may find the following aliases useful:

alias conditions='wu'
alias forecast='wu -forecast'
alias forecast10='wu -forecast10'
alias alerts='wu -alerts'
alias astronomy='wu -astro'
alias yesterday='wu -yesterday'
alias almanac='wu -almanac'
alias tides='wu -tides'
alias slookup='wu -lookup'

License(s)

Wu is written and maintained by Stephen Ramsay (sramsay{at}protonmail{dot}com) and Anthony Starks.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Data courtesy of Weather Underground, Inc. (WUI) is subject to the Weather Underground API Terms and Conditions of Use. The author of this software is not affiliated with WUI, and the software is neither sponsored nor endorsed by WUI.

Thanks

Wu was heavily inspired by Jeremy Stanley's weather. This is a lovely Python script that has more-or-less the same output format as wu. I reimplemented the system because Stanley's had stopped working (for me) and I wanted a program that was faster. I also wanted a system that takes advantage of Weather Underground's rich JSON API.

About

A fast command-line weather app

License:GNU General Public License v3.0


Languages

Language:Go 100.0%