|
|
@ -1,16 +1,17 @@
|
|
|
|
*wttr.in — the right way to check the weather.*
|
|
|
|
*wttr.in — the right way to check the weather!*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wttr.in is a console-oriented weather forecast service that supports various information
|
|
|
|
|
|
|
|
representation methods like terminal-oriented ANSI-sequences for console HTTP clients
|
|
|
|
|
|
|
|
(curl, httpie, or wget), HTML for web browsers, or PNG for graphical viewers.
|
|
|
|
|
|
|
|
|
|
|
|
wttr.in is a console oriented weather forecast service, that supports various information representation methods
|
|
|
|
|
|
|
|
like terminal oriented ANSI-sequences for console HTTP clients (curl, httpie, or wget),
|
|
|
|
|
|
|
|
HTML for web browsers, or PNG for graphical viewers.
|
|
|
|
|
|
|
|
wttr.in uses [wego](http://github.com/schachmat/wego) for visualization
|
|
|
|
wttr.in uses [wego](http://github.com/schachmat/wego) for visualization
|
|
|
|
and various data sources for weather forecast information.
|
|
|
|
and various data sources for weather forecast information.
|
|
|
|
|
|
|
|
|
|
|
|
You can check it at [wttr.in](http://wttr.in).
|
|
|
|
You can see it running here: [wttr.in](http://wttr.in).
|
|
|
|
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
|
|
|
|
You can access the service from a shell or from a Web browser:
|
|
|
|
You can access the service from a shell or from a Web browser like this:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in
|
|
|
|
$ curl wttr.in
|
|
|
|
Weather for City: Paris, France
|
|
|
|
Weather for City: Paris, France
|
|
|
@ -22,42 +23,42 @@ You can access the service from a shell or from a Web browser:
|
|
|
|
/ \ 0.0 mm
|
|
|
|
/ \ 0.0 mm
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
That is how the actual weather report for your location looks like (it is live!):
|
|
|
|
Here is an actual weather report for your location (it's live!):
|
|
|
|
|
|
|
|
|
|
|
|
![Weather Report](http://wttr.in/MyLocation.png?)
|
|
|
|
![Weather Report](http://wttr.in/MyLocation.png?)
|
|
|
|
|
|
|
|
|
|
|
|
(it's not your location actually. GitHub's CDN hides your real IP address with its own IP address,
|
|
|
|
(It's not your actual location - GitHub's CDN hides your real IP address with its own IP address,
|
|
|
|
but it is still a live weather report in your language).
|
|
|
|
but it's still a live weather report in your language.)
|
|
|
|
|
|
|
|
|
|
|
|
You can specify the location that you want to get the weather information for.
|
|
|
|
Want to get the weather information for a specific location? You can add the desired location to the URL in your
|
|
|
|
If you omit the location name, you will get the report for your current location,
|
|
|
|
request like this:
|
|
|
|
based on your IP address.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/London
|
|
|
|
$ curl wttr.in/London
|
|
|
|
$ curl wttr.in/Moscow
|
|
|
|
$ curl wttr.in/Moscow
|
|
|
|
|
|
|
|
|
|
|
|
Use 3-letters airport codes in order to get the weather information
|
|
|
|
If you omit the location name, you will get the report for your current location based on your IP address.
|
|
|
|
at a certain airport:
|
|
|
|
|
|
|
|
|
|
|
|
Use 3-letter airport codes in order to get the weather information at a certain airport:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/muc # Weather for IATA: muc, Munich International Airport, Germany
|
|
|
|
$ curl wttr.in/muc # Weather for IATA: muc, Munich International Airport, Germany
|
|
|
|
$ curl wttr.in/ham # Weather for IATA: ham, Hamburg Airport, Germany
|
|
|
|
$ curl wttr.in/ham # Weather for IATA: ham, Hamburg Airport, Germany
|
|
|
|
|
|
|
|
|
|
|
|
If you want to use some geographical location (not just a town or a city)
|
|
|
|
Let's say you'd like to get the weather for a geographical location other than a town or city - maybe an attraction
|
|
|
|
(e.g. it can be a site in a city, a mountain name, a special location, etc.) you should place `~` before its name.
|
|
|
|
in a city, a mountain name, or some special location. Add the character `~` before the name to look up that special
|
|
|
|
That means the location name should be looked up before:
|
|
|
|
location name before the weather is then retrieved:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/~Vostok+Station
|
|
|
|
$ curl wttr.in/~Vostok+Station
|
|
|
|
$ curl wttr.in/~Eiffel+Tower
|
|
|
|
$ curl wttr.in/~Eiffel+Tower
|
|
|
|
$ curl wttr.in/~Kilimanjaro
|
|
|
|
$ curl wttr.in/~Kilimanjaro
|
|
|
|
|
|
|
|
|
|
|
|
In this case there is a line below the weather forecast output describing the founded precise position:
|
|
|
|
For these examples, you'll see a line below the weather forecast output that shows the geolocation
|
|
|
|
|
|
|
|
results of looking up the location:
|
|
|
|
|
|
|
|
|
|
|
|
Location: Vostok Station, станция Восток, AAT, Antarctica [-78.4642714,106.8364678]
|
|
|
|
Location: Vostok Station, станция Восток, AAT, Antarctica [-78.4642714,106.8364678]
|
|
|
|
Location: Tour Eiffel, 5, Avenue Anatole France, Gros-Caillou, 7e, Paris, Île-de-France, 75007, France [48.8582602,2.29449905432]
|
|
|
|
Location: Tour Eiffel, 5, Avenue Anatole France, Gros-Caillou, 7e, Paris, Île-de-France, 75007, France [48.8582602,2.29449905432]
|
|
|
|
Location: Kilimanjaro, Northern, Tanzania [-3.4762789,37.3872648]
|
|
|
|
Location: Kilimanjaro, Northern, Tanzania [-3.4762789,37.3872648]
|
|
|
|
|
|
|
|
|
|
|
|
You can also use IP-addresses (direct) or domain names (prefixed with @)
|
|
|
|
You can also use IP-addresses (direct) or domain names (prefixed with `@`) to specify a location:
|
|
|
|
as a location specificator:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/@github.com
|
|
|
|
$ curl wttr.in/@github.com
|
|
|
|
$ curl wttr.in/@msu.ru
|
|
|
|
$ curl wttr.in/@msu.ru
|
|
|
@ -66,17 +67,17 @@ To get detailed information online, you can access the [/:help](http://wttr.in/:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/:help
|
|
|
|
$ curl wttr.in/:help
|
|
|
|
|
|
|
|
|
|
|
|
## Additional options
|
|
|
|
### Weather Units
|
|
|
|
|
|
|
|
|
|
|
|
By default the USCS units are used for the queries from the USA and the metric system for the rest of the world.
|
|
|
|
By default the USCS units are used for the queries from the USA and the metric system for the rest of the world.
|
|
|
|
You can override this behavior with the following options:
|
|
|
|
You can override this behavior by adding `?u` or `?m` to a URL like this:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/Amsterdam?u
|
|
|
|
$ curl wttr.in/Amsterdam?u
|
|
|
|
$ curl wttr.in/Amsterdam?m
|
|
|
|
$ curl wttr.in/Amsterdam?m
|
|
|
|
|
|
|
|
|
|
|
|
## Supported formats
|
|
|
|
## Supported output formats
|
|
|
|
|
|
|
|
|
|
|
|
wttr.in supports three output formats at the moment:
|
|
|
|
wttr.in currently supports three output formats:
|
|
|
|
|
|
|
|
|
|
|
|
* ANSI for the terminal;
|
|
|
|
* ANSI for the terminal;
|
|
|
|
* HTML for the browser;
|
|
|
|
* HTML for the browser;
|
|
|
@ -97,39 +98,38 @@ Useful options for the PNG format:
|
|
|
|
* `t` for transparency (`transparency=150`);
|
|
|
|
* `t` for transparency (`transparency=150`);
|
|
|
|
* transparency=0..255 for a custom transparency level.
|
|
|
|
* transparency=0..255 for a custom transparency level.
|
|
|
|
|
|
|
|
|
|
|
|
Transparency is a useful feature when the weather PNGs are used to
|
|
|
|
Transparency is a useful feature when weather PNGs are used to add weather data to pictures:
|
|
|
|
add weather data to the pictures:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$ convert 1.jpg <( curl wttr.in/Oymyakon_tqp0.png ) -geometry +50+50 -composite 2.jpg
|
|
|
|
$ convert source.jpg <( curl wttr.in/Oymyakon_tqp0.png ) -geometry +50+50 -composite target.jpg
|
|
|
|
|
|
|
|
|
|
|
|
Here:
|
|
|
|
In this example:
|
|
|
|
|
|
|
|
|
|
|
|
* `1.jpg` - source file;
|
|
|
|
* `source.jpg` - source file;
|
|
|
|
* `2.jpg` - target file;
|
|
|
|
* `target.jpg` - target file;
|
|
|
|
* Oymyakon - name of the location;
|
|
|
|
* `Oymyakon` - name of the location;
|
|
|
|
* tqp0 - options (recommended).
|
|
|
|
* `tqp0` - options (recommended).
|
|
|
|
|
|
|
|
|
|
|
|
![Picture with weather data](https://pbs.twimg.com/media/C69-wsIW0AAcAD5.jpg)
|
|
|
|
![Picture with weather data](https://pbs.twimg.com/media/C69-wsIW0AAcAD5.jpg)
|
|
|
|
|
|
|
|
|
|
|
|
## Special pages
|
|
|
|
## Moon phases
|
|
|
|
|
|
|
|
|
|
|
|
wttr.in can be used not only to check the weather:
|
|
|
|
wttr.in can also be used to check the phase of the Moon. This example shows how to see the current Moon phase:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/Moon
|
|
|
|
$ curl wttr.in/Moon
|
|
|
|
|
|
|
|
|
|
|
|
To see the current Moon phase (uses [pyphoon](https://github.com/chubin/pyphoon) as its backend).
|
|
|
|
Get the Moon phase for a particular date by adding `@YYYY-MM-DD`:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/Moon@2016-12-25
|
|
|
|
$ curl wttr.in/Moon@2016-12-25
|
|
|
|
|
|
|
|
|
|
|
|
To see the Moon phase for the specified date (2016-12-25).
|
|
|
|
The Moon phase information uses [pyphoon](https://github.com/chubin/pyphoon) as its backend.
|
|
|
|
|
|
|
|
|
|
|
|
## Internationalization and localization
|
|
|
|
## Internationalization and localization
|
|
|
|
|
|
|
|
|
|
|
|
wttr.in supports multilingual locations names: they can be specified in any language in the world
|
|
|
|
wttr.in supports multilingual locations names that can be specified in any language in the world
|
|
|
|
(it may be surprising, but many locations in the world do not have any English name at all).
|
|
|
|
(it may be surprising, but many locations in the world don't have an English name).
|
|
|
|
|
|
|
|
|
|
|
|
The query string should be specified in Unicode (hex encoded or not). If it contains spaces
|
|
|
|
The query string should be specified in Unicode (hex-encoded or not). Spaces in the query string
|
|
|
|
they must be replaced with +:
|
|
|
|
must be replaced with `+`:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/станция+Восток
|
|
|
|
$ curl wttr.in/станция+Восток
|
|
|
|
Weather report: станция Восток
|
|
|
|
Weather report: станция Восток
|
|
|
@ -144,48 +144,51 @@ The language used for the output (except the location name) does not depend on t
|
|
|
|
and it is either English (by default) or the preferred language of the browser (if the query
|
|
|
|
and it is either English (by default) or the preferred language of the browser (if the query
|
|
|
|
was issued from a browser) that is specified in the query headers (`Accept-Language`).
|
|
|
|
was issued from a browser) that is specified in the query headers (`Accept-Language`).
|
|
|
|
|
|
|
|
|
|
|
|
It can be set explicitly when using console clients by means of the appropriate command line options
|
|
|
|
The language can be set explicitly when using console clients by using command-line options like this:
|
|
|
|
(for example: `curl -H "Accept-Language: fr" wttr.in` or `http GET wttr.in Accept-Language:ru`).
|
|
|
|
|
|
|
|
|
|
|
|
curl -H "Accept-Language: fr" wttr.in
|
|
|
|
|
|
|
|
http GET wttr.in Accept-Language:ru
|
|
|
|
|
|
|
|
|
|
|
|
The preferred language can be forced using the `lang` option:
|
|
|
|
The preferred language can be forced using the `lang` option:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl wttr.in/Berlin?lang=de
|
|
|
|
$ curl wttr.in/Berlin?lang=de
|
|
|
|
|
|
|
|
|
|
|
|
The third option is to choose the language using DNS name used in the query:
|
|
|
|
The third option is to choose the language using the DNS name used in the query:
|
|
|
|
|
|
|
|
|
|
|
|
$ curl de.wttr.in/Berlin
|
|
|
|
$ curl de.wttr.in/Berlin
|
|
|
|
|
|
|
|
|
|
|
|
wttr.in is currently translated into 54 languages and the number of supported languages
|
|
|
|
wttr.in is currently translated into 54 languages, and the number of supported languages is constantly growing.
|
|
|
|
is constantly growing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See [/:translation](http://wttr.in/:translation) to learn more about the translation process,
|
|
|
|
See [/:translation](http://wttr.in/:translation) to learn more about the translation process,
|
|
|
|
to see the list of supported languages and contributors, or to know how you can help to translate wttr.in in your language.
|
|
|
|
to see the list of supported languages and contributors, or to know how you can help to translate wttr.in
|
|
|
|
|
|
|
|
in your language.
|
|
|
|
|
|
|
|
|
|
|
|
![Queries to wttr.in in various languages](https://pbs.twimg.com/media/C7hShiDXQAES6z1.jpg)
|
|
|
|
![Queries to wttr.in in various languages](https://pbs.twimg.com/media/C7hShiDXQAES6z1.jpg)
|
|
|
|
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
|
|
|
|
To install the program:
|
|
|
|
To install the application:
|
|
|
|
|
|
|
|
|
|
|
|
1. Install external dependencies
|
|
|
|
1. Install external dependencies
|
|
|
|
2. Install python dependencies used by the service
|
|
|
|
2. Install Python dependencies used by the service
|
|
|
|
3. Get WorldWeatherOnline API Key
|
|
|
|
3. Get a WorldWeatherOnline API Key
|
|
|
|
4. Configure wego
|
|
|
|
4. Configure wego
|
|
|
|
5. Configure wttr.in
|
|
|
|
5. Configure wttr.in
|
|
|
|
6. Configure HTTP-frontend service
|
|
|
|
6. Configure the HTTP-frontend service
|
|
|
|
|
|
|
|
|
|
|
|
### Install external dependencies
|
|
|
|
### Install external dependencies
|
|
|
|
|
|
|
|
|
|
|
|
External requirements:
|
|
|
|
wttr.in has the following external dependencies:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* [golang](https://golang.org/doc/install), wego dependency
|
|
|
|
* [wego](https://github.com/schachmat/wego), weather client for terminal
|
|
|
|
* [wego](https://github.com/schachmat/wego), weather client for terminal
|
|
|
|
|
|
|
|
|
|
|
|
To install `wego` you must have [golang](https://golang.org/doc/install) installed. After that:
|
|
|
|
After you install [golang](https://golang.org/doc/install), install `wego`:
|
|
|
|
|
|
|
|
|
|
|
|
$ go get -u github.com/schachmat/wego
|
|
|
|
$ go get -u github.com/schachmat/wego
|
|
|
|
$ go install github.com/schachmat/wego
|
|
|
|
$ go install github.com/schachmat/wego
|
|
|
|
|
|
|
|
|
|
|
|
### Install python dependencies
|
|
|
|
### Install Python dependencies
|
|
|
|
|
|
|
|
|
|
|
|
Python requirements:
|
|
|
|
Python requirements:
|
|
|
|
|
|
|
|
|
|
|
@ -195,7 +198,7 @@ Python requirements:
|
|
|
|
* requests
|
|
|
|
* requests
|
|
|
|
* gevent
|
|
|
|
* gevent
|
|
|
|
|
|
|
|
|
|
|
|
If you want to get weather reports as PNG files, install also:
|
|
|
|
If you want to get weather reports as PNG files, you'll also need to install:
|
|
|
|
|
|
|
|
|
|
|
|
* PIL
|
|
|
|
* PIL
|
|
|
|
* pyte (>=0.6)
|
|
|
|
* pyte (>=0.6)
|
|
|
@ -210,17 +213,17 @@ If `virtualenv` is used:
|
|
|
|
$ ve/bin/pip bin/srv.py
|
|
|
|
$ ve/bin/pip bin/srv.py
|
|
|
|
|
|
|
|
|
|
|
|
Also, you need to install the geoip2 database.
|
|
|
|
Also, you need to install the geoip2 database.
|
|
|
|
You can use a free database GeoLite2, that can be downloaded from http://dev.maxmind.com/geoip/geoip2/geolite2/
|
|
|
|
You can use a free database GeoLite2 that can be downloaded from (http://dev.maxmind.com/geoip/geoip2/geolite2/).
|
|
|
|
|
|
|
|
|
|
|
|
### Get WorldWeatherOnline key
|
|
|
|
### Get a WorldWeatherOnline key
|
|
|
|
|
|
|
|
|
|
|
|
To get the WorldWeatherOnline API key, you must register here:
|
|
|
|
To get a WorldWeatherOnline API key, you must register here:
|
|
|
|
|
|
|
|
|
|
|
|
https://developer.worldweatheronline.com/auth/register
|
|
|
|
https://developer.worldweatheronline.com/auth/register
|
|
|
|
|
|
|
|
|
|
|
|
### Configure wego
|
|
|
|
### Configure wego
|
|
|
|
|
|
|
|
|
|
|
|
After you have the key, configure `wego`:
|
|
|
|
After you have a WorldWeatherOnline key, you can configure `wego`:
|
|
|
|
|
|
|
|
|
|
|
|
$ cat ~/.wegorc
|
|
|
|
$ cat ~/.wegorc
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -235,8 +238,8 @@ The `City` parameter in `~/.wegorc` is ignored.
|
|
|
|
|
|
|
|
|
|
|
|
### Configure wttr.in
|
|
|
|
### Configure wttr.in
|
|
|
|
|
|
|
|
|
|
|
|
Configure the following environment variables specifing the path to the local `wttr.in`
|
|
|
|
Configure the following environment variables that define the path to the local `wttr.in`
|
|
|
|
installation, to the GeoLite database and to the `wego` installation. For example:
|
|
|
|
installation, to the GeoLite database, and to the `wego` installation. For example:
|
|
|
|
|
|
|
|
|
|
|
|
export WTTR_MYDIR="/home/igor/wttr.in"
|
|
|
|
export WTTR_MYDIR="/home/igor/wttr.in"
|
|
|
|
export WTTR_GEOLITE="/home/igor/wttr.in/GeoLite2-City.mmdb"
|
|
|
|
export WTTR_GEOLITE="/home/igor/wttr.in/GeoLite2-City.mmdb"
|
|
|
@ -245,10 +248,9 @@ installation, to the GeoLite database and to the `wego` installation. For exampl
|
|
|
|
export WTTR_LISTEN_PORT="8002"
|
|
|
|
export WTTR_LISTEN_PORT="8002"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Configure HTTP-frontend service
|
|
|
|
### Configure the HTTP-frontend service
|
|
|
|
|
|
|
|
|
|
|
|
Configure the web server, that will be used
|
|
|
|
It's recommended that you also configure the web server that will be used to access the service:
|
|
|
|
to access the service (if you want to use a web frontend; it's recommended):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
server {
|
|
|
|
server {
|
|
|
|
listen [::]:80;
|
|
|
|
listen [::]:80;
|
|
|
@ -278,5 +280,3 @@ to access the service (if you want to use a web frontend; it's recommended):
|
|
|
|
expires off;
|
|
|
|
expires off;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|