This is a shell script that scrapes hourly weather tables from yr.
$ weather.sh
Updated 22:27.How often is the weather forecast updated?
Forecast as PDFForecast as SVG
***** Monday 1 May *****
Display for hour-by-hour forecast.
Time Weather Temp. Precip. mm Wind speed m/s Wind desc.
00 [clear sky] 5° 0 2 m/s from east2 Light breeze from east
01 [clear sky] 4° 0 3 m/s from east3 Light breeze from east
02 [clear sky] 4° 0 2 m/s from east2 Light breeze from east
03 [clear sky] 4° 0 3 m/s from east3 Light breeze from east
04 [clear sky] 4° 0 3 m/s from south Light breeze from
east3 south east
05 [clear sky] 3° 0 3 m/s from south Light breeze from
east3 south east
06 [clear sky] 3° 0 3 m/s from south Light breeze from
east3 south east
07 [partly cloudy] 5° 0 4 m/s from south Gentle breeze from
east4 south east
08 [partly cloudy] 7° 0 3 m/s from south Light breeze from
east3 south east
09 [partly cloudy] 9° 0 3 m/s from south Light breeze from
east3 south east
10 [partly cloudy] 11° 0 4 m/s from south Gentle breeze from
east4 south east
11 [partly cloudy] 13° 0 4 m/s from south Gentle breeze from
east4 south east
12 [partly cloudy] 14° 0 4 m/s from south Gentle breeze from
east4 south east
13 [partly cloudy] 15° 0 4 m/s from south Gentle breeze from
east4 south east
14 [partly cloudy] 16° 0 4 m/s from south Gentle breeze from
east4 south east
15 [partly cloudy] 17° 0 4 m/s from south Gentle breeze from
east4 south east
16 [cloudy] 17° 0 4 m/s from south Gentle breeze from
east4 south east
17 [cloudy] 16° 0 3 m/s from south Light breeze from
east3 south east
18 [cloudy] 16° 0 3 m/s from south Light breeze from
east3 south east
19 [cloudy] 15° 0 2 m/s from south Light breeze from
east2 south east
20 [cloudy] 13° 0 2 m/s from south Light breeze from
east2 south east
21 [cloudy] 14° 0 2 m/s from north2 Light breeze from
north
22 [cloudy] 13° 0 1 m/s from east1 Light air from east
23 [cloudy] 11° 0 2 m/s from south Light breeze from
east2 south east
Sunrise
05:35
Sunset
20:32
Next day
***** Footer *****
- Get IDs of your locations by using search in aforementioned website and copying them from URL and add them to the associative array LOCATIONS. You can have as many locations as you want :).
- On line 7 replace "berlin" with whatever default location you want in case no location is passed to the script.
Get info from default location for current day:
./weather.sh
Get info from set location for today (the 0 is not needed when scraping current day):
./weather.sh berlin 0
Get info from set location for day after today:
./weather.sh berlin 1
html2text