From af52fe7ebcd04a6d2ad32c45eca696014559774b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 27 Jul 2018 08:55:20 +0800 Subject: [PATCH] translated --- ... Forecast In Your Terminal With Wttr.in.md | 119 ------------------ ... Forecast In Your Terminal With Wttr.in.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md create mode 100644 translated/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md diff --git a/sources/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md b/sources/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md deleted file mode 100644 index e44fef0cb6..0000000000 --- a/sources/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md +++ /dev/null @@ -1,119 +0,0 @@ -translating---geekpi - -Display Weather Forecast In Your Terminal With Wttr.in -====== -**[wttr.in][1] is a feature-packed weather forecast service that supports displaying the weather from the command line**. It can automatically detect your location (based on your IP address), supports specifying the location or searching for a geographical location (like a site in a city, a mountain and so on), and much more. Oh, and **you don't have to install it - all you need to use it is cURL or Wget** (see below). - -wttr.in features include: - - * **displays the current weather as well as a 3-day weather forecast, split into morning, noon, evening and night** (includes temperature range, wind speed and direction, viewing distance, precipitation amount and probability) - - * **can display Moon phases** - - * **automatic location detection based on your IP address** - - * **allows specifying a location using the city name, 3-letter airport code, area code, GPS coordinates, IP address, or domain name**. You can also specify a geographical location like a lake, mountain, landmark, and so on) - - * **supports multilingual location names** (the query string must be specified in Unicode) - - * **supports specifying the language** in which the weather forecast should be displayed in (it supports more than 50 languages) - - * **it uses USCS units for queries from the USA and the metric system for the rest of the world** , but you can change this by appending `?u` for USCS, and `?m` for the metric system (SI) - - * **3 output formats: ANSI for the terminal, HTML for the browser, and PNG**. - - - - -Like I mentioned in the beginning of the article, to use wttr.in, all you need is cURL or Wget, but you can also - -**Before using wttr.in, make sure cURL is installed.** In Debian, Ubuntu or Linux Mint (and other Debian or Ubuntu-based Linux distributions), install cURL using this command: -``` -sudo apt install curl - -``` - -### wttr.in command line examples - -Get the weather for your location (wttr.in tries to guess your location based on your IP address): -``` -curl wttr.in - -``` - -Force cURL to resolve names to IPv4 addresses (in case you're having issues with IPv6 and wttr.in) by adding `-4` after `curl` : -``` -curl -4 wttr.in - -``` - -**Wget also works** (instead of cURL) if you want to retrieve the current weather and forecast as a png, or if you use it like this: -``` -wget -O- -q wttr.in - -``` - -You can replace `curl` with `wget -O- -q` in all the commands below if you prefer Wget over cURL. - -Specify the location: -``` -curl wttr.in/Dublin - -``` - -Display weather information for a landmark (the Eiffel Tower in this example): -``` -curl wttr.in/~Eiffel+Tower - -``` - -Get the weather information for an IP address' location (the IP below belongs to GitHub): -``` -curl wttr.in/@192.30.253.113 - -``` - -Retrieve the weather using USCS units: -``` -curl wttr.in/Paris?u - -``` - -Force wttr.in to use the metric system (SI) if you're in the USA: -``` -curl wttr.in/New+York?m - -``` - -Use Wget to download the current weather and 3-day forecast as a PNG image: -``` -wget wttr.in/Istanbul.png - -``` - -You can specify the PNG - -**For many other examples, check out the wttr.in[project page][2] or type this in a terminal:** -``` -curl wttr.in/:help - -``` - - --------------------------------------------------------------------------------- - -via: https://www.linuxuprising.com/2018/07/display-weather-forecast-in-your.html - -作者:[Logix][a] -选题:[lujun9972](https://github.com/lujun9972) -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]:https://plus.google.com/118280394805678839070 -[1]:https://wttr.in/ -[2]:https://github.com/chubin/wttr.in -[3]:https://github.com/chubin/wttr.in#installation -[4]:https://github.com/schachmat/wego -[5]:https://github.com/chubin/wttr.in#supported-formats diff --git a/translated/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md b/translated/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md new file mode 100644 index 0000000000..fa03d11765 --- /dev/null +++ b/translated/tech/20180710 Display Weather Forecast In Your Terminal With Wttr.in.md @@ -0,0 +1,118 @@ +使用 Wttr.in 在你的终端中显示天气预报 +====== +**[wttr.in][1] 是一个功能丰富的天气预报服务,它支持在命令行显示天气**。它可以自动检测你的位置(根据你的 IP 地址),支持指定位置或搜索地理位置(如城市、山区等)等。哦,另外**你不需要安装它 - 你只需要使用 cURL 或 Wget**(见下文)。 + +wttr.in 功能包括: + + * **显示当前天气以及 3 天天气预报,分为早晨、中午、傍晚和夜晚**(包括温度范围、风速和风向、可见度、降水量和概率) + + * **可以显示月相** + + * **基于你的 IP 地址自动检测位置** + + * **允许指定城市名称、3 字母的机场代码、区域代码、GPS 坐标、IP 地址或域名**。你还可以指定地理位置,如湖泊、山脉、地标等) + + * **支持多语言位置名称**(查询字符串必须以 Unicode 指定) + + * **支持指定**天气预报显示的语言(它支持超过 50 种语言) + + * **it uses USCS units for queries from the USA and the metric system for the rest of the world** , but you can change this by appending `?u` for USCS, and `?m` for the metric system (SI) + * **来自美国的查询使用 USCS 单位用于,世界其他地方使用公制系统**,但你可以通过附加 `?u` 使用 USCS,附加 `?m` 使用公制系统。 ) + + * **3 种输出格式:终端的 ANSI,浏览器的 HTML 和 PNG**。 + + + + +就像我在文章开头提到的那样,使用 wttr.in,你只需要 cURL 或 Wget,但你也可以 + +**在使用 wttr.in 之前,请确保已安装 cURL。**在 Debian、Ubuntu 或 Linux Mint(以及其他基于 Debian 或 Ubuntu 的 Linux 发行版)中,使用以下命令安装 cURL: +``` +sudo apt install curl + +``` + +### wttr.in 命令行示例 + +获取你所在位置的天气(wttr.in 会根据你的 IP 地址猜测你的位置): +``` +curl wttr.in + +``` + +通过在 `curl` 之后添加 `-4`,强制 cURL 将名称解析为 IPv4 地址(如果你遇到 IPv6 和 wttr.in 问题): +``` +curl -4 wttr.in + +``` + +如果你想检索天气预报保存为 png,**还可以使用 Wget**(而不是 cURL),或者你想这样使用它: +``` +wget -O- -q wttr.in + +``` + +如果相对 cURL 你更喜欢 Wget ,可以在下面的所有命令中用 `wget -O- -q` 替换 `curl`。 + +指定位置: +``` +curl wttr.in/Dublin + +``` + +显示地标的天气信息(本例中为艾菲尔铁塔): +``` +curl wttr.in/~Eiffel+Tower + +``` + +获取 IP 地址位置的天气信息(以下 IP 属于 GitHub): +``` +curl wttr.in/@192.30.253.113 + +``` + +使用 USCS 单位检索天气: +``` +curl wttr.in/Paris?u + +``` + +如果你在美国,强制 wttr.in 使用公制系统(SI): +``` +curl wttr.in/New+York?m + +``` + +使用 Wget 将当前天气和 3 天预报下载为 PNG 图像: +``` +wget wttr.in/Istanbul.png + +``` + +你可以指定 PNG 名称 + +**对于其他示例,请查看 wttr.in [项目页面][2]或在终端中输入:** +``` +curl wttr.in/:help + +``` + + +-------------------------------------------------------------------------------- + +via: https://www.linuxuprising.com/2018/07/display-weather-forecast-in-your.html + +作者:[Logix][a] +选题:[lujun9972](https://github.com/lujun9972) +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]:https://plus.google.com/118280394805678839070 +[1]:https://wttr.in/ +[2]:https://github.com/chubin/wttr.in +[3]:https://github.com/chubin/wttr.in#installation +[4]:https://github.com/schachmat/wego +[5]:https://github.com/chubin/wttr.in#supported-formats