Wu

Version 3.10.0

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

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 and 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{dot}unl{at}gmail{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.



Wu

版本3.10.0

wu 是一个小而快速的命令行应用程序,可从天气地下检索天气数据。 p>

说明

要使用 wu,,您需要从Weather Underground http:// www .wunderground.com / weather / api / 。然后,您应该将该密钥和默认气象站的名称以及您对华氏或Celcius(3.10中的新功能)的偏好添加到$ HOME / .condrc。例如:

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

(以上是在wu根目录中提供的condrc)

wu具有以下主要选项:

  • - 条件报告当前天气情况。

  • - 预测显示当前(3天)预测。

  • - forecast10 显示当前(10天)预测。

  • - 警报报告任何活动的天气警报。

  • - 查找[STATION] 可以确定特定区域内各种气象站的代码。 STATION的格式与下面的-s开关的格式相同。

  • - 天文学报告日出,日落和月球阶段。

  • - almanac 报告平均高温和低温,以及当天的气温。

  • - 昨天提供前一天的详细信息。

  • - history = YYYYMMDD 给出了给定日期的详细信息。

  • - planner = MMDDMMDD 给出旅行计划的平均值(最多30天)。

  • - 潮汐报告潮汐数据(可用时)。

  • - 所有生成所有报告(可用于创建自定义报告,并使真正的天气变得脆弱)。

所有十二个选项可以伴随着-s开关,可用于覆盖.condrc中的默认位置。传递给-s的参数可以是城市,州名缩写/国家,(美国或加拿大)邮政编码,三或四字母机场代码,或纬度,长。

wu 还有两个附加开关,提供有关程序的信息:

  • - help
  • - version

本身, wu 命令将显示当前条件。

编译安装Wu

Mac用户可以通过 Homebrew 系统输入以下内容来安装wu:

brew install wu

它也可以从源代码编译。吴写在 Go编程语言(版本1.0或更高版本)中。如果您没有Go编译器,请您需要安装一个。

获取wu的源代码:

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

要编译wu可执行文件,请键入:

go build

要编译和安装可排除类型:

go install

(这将安装在由GOPATH变量指定的位置)。

Wu应该可以在任何可以编译Go程序的系统上工作。

您可能会发现以下别名有用:

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'

许可证

吴先生由 Stephen Ramsay (sramsay {dot} unl {at} gmail {dot} com)和安东尼·斯塔克斯

该程序是免费软件:您可以根据自由软件基金会发布的GNU通用公共许可证(许可证版本3)或(随后选择)重新分发和/或修改它版本。

这个程序是分发的,希望它是有用的,但没有任何保证;甚至没有适销性或适用于特定用途的默示保证。有关详细信息,请参阅GNU通用公共许可证。

您应该已经收到GNU通用公共许可证的副本以及此程序。如果没有,请参阅 http://www.gnu.org/licenses/

数据由Weather Underground,Inc.(WUI)提供,受 Weather Underground API条款和条件的约束的使用。该软件的作者不隶属于WUI,该软件既不是由WUI赞助也没有得到认可。

谢谢

吴先生受到Jeremy Stanley的天气的极大启发。这是一个可爱的Python脚本,具有或多或少的与wu相同的输出格式。因为Stanley已经停止工作(对我来说),我重新实现了系统,我想要一个更快的程序。我还想要一个利用Weather Underground丰富的 JSON API的系统。




相关问题推荐