Page 1 of 1

weather forecast in terminal

Posted: Sun May 31, 2015 5:59 am
by vic
I have not tried it. Just got a tip about it. Click and check link if you are interested. :)

https://github.com/schachmat/wego

Re: weather forecast in terminal

Posted: Sun May 31, 2015 3:12 pm
by machinebacon
Thanks Wickie!
Working Go environment
Well, I'll consider this some other time :D

I used to have this one: https://github.com/fcambus/ansiweather
Needs jq from the repos and a little bit of editing in the config file :)

Re: weather forecast in terminal

Posted: Sat Jan 09, 2016 11:52 pm
by Theo
necrobump but...

inxi -xxxW cityname,country works for me :)

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 12:51 am
by daggoth
^^ Works for me! Didn't know that one.

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 1:52 am
by dkeg
Oh, cool, worthy necro bump! I had to do city,state

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 1:59 am
by Dr_Chroot
No kidding, this is pretty nice. At least from a quick glance at the man page, inxi does so much more than I knew about!

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 2:07 am
by pidsley

Code: Select all

$ sudo apt-get install weather-util weather-util-data
$ weather $ weather atl
Current conditions at Hartsfield-Jackson Atlanta, GA
Last updated Jan 09, 2016 - 07:52 PM EST / 2016.01.10 0052 UTC
   Temperature: 50.0 F (10.0 C)
   Relative Humidity: 92%
   Wind: from the ESE (120 degrees) at 10 MPH (9 KT)
   Weather: light rain; mist
   Sky conditions: overcast
   Precipitation last hour: 0.08 inches
$ weather eddb
Searching via station...
[caching result Berlin-Schoenefeld, Germany]
Current conditions at Berlin-Schoenefeld, Germany (EDDB) 52-23N 013-31E 50M
Last updated Jan 09, 2016 - 07:50 PM EST / 2016.01.10 0050 UTC
   Temperature: 26 F (-3 C)
   Relative Humidity: 92%
   Wind: from the E (100 degrees) at 6 MPH (5 KT)
   Windchill: 19 F (-7 C)
"man weather" for more -- "weather -f <code>" for a forecast (only US codes), get codes from here or "weather --info" to search by name.

Code: Select all

$ weather --info beijing
Searching via name...
ICAO station code zbaa
----------------------
zbaa: Beijing, China
   (proximity ideal, 0km, 0mi)
$ weather zbaa
Current conditions at Beijing, China (ZBAA) 39-56N 116-17E 55M
Last updated Jan 09, 2016 - 08:00 PM EST / 2016.01.10 0100 UTC
   Temperature: 28 F (-2 C)
   Relative Humidity: 39%
   Wind: from the NNE (030 degrees) at 7 MPH (6 KT)
   Windchill: 21 F (-6 C)

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 5:02 am
by machinebacon
^ excellent, thank you!

user@grill:~$ weather Paris
Searching via name...
Your search is too ambiguous, returning 107 matches.
user@grill:~$ weather Novosibirsk
Searching via name...
[using result Novosibirsk/Tolmach, RA]
Current conditions at <UNKNOWN>
Last updated Jan 10, 2016 - 12:00 AM EST / 2016.01.10 0500 UTC
Temperature: -14 F (-26 C)
Relative Humidity: 75%
Wind: Variable at 2 MPH (2 KT)
user@grill:~$

that's brilliant, it works well if the weather station has a unique name.

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 2:06 pm
by pidsley
You can also look up the station code for cities like Paris, and use that.

https://www.aviationweather.gov/docs/metar/stations.txt

Code: Select all

$ weather lfpb
Searching via station...
[caching result Paris / Le Bourget, France]
Current conditions at Paris / Le Bourget, France (LFPB) 48-58N 002-27E 65M
Last updated Jan 10, 2016 - 07:30 AM EST / 2016.01.10 1230 UTC
   Temperature: 46 F (8 C)
   Relative Humidity: 87%
   Wind: from the SSW (210 degrees) at 14 MPH (12 KT)
   Weather: Towering cumulus clouds observed
   Sky conditions: mostly cloudy
Or use the latitude and longitude to find the nearest station.

Code: Select all

$ weather "27-17S, 28-31E"                                                                                                                                                  
Searching via coordinates...
No NWS weather zone near 27-17S, 028-31E; forecasts unavailable.
Current conditions at Vereeniging, South Africa (FAVV) 26-34-29S 027-57-45E
Last updated Jan 10, 2016 - 08:00 AM EST / 2016.01.10 1300 UTC
   Temperature: 82 F (28 C)
   Relative Humidity: 34%
   Wind: from the NW (320 degrees) at 7 MPH (6 KT)

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 2:12 pm
by machinebacon
the "Paris" search was on purpose, wanted to see what happens if there are definitely more than one stations. Thanks :)

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 2:14 pm
by pidsley
Oh! Sorry about that. I was caught up in the cool man page and all the options.

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 2:25 pm
by machinebacon
Nothing to feel sorry about :D I have never even considered/heard of weather-utils, so this is really a great tip!

The city I live in has a unique name, so it showed directly. Then I tried Stuttgart, which I knew has at least 2 stations. It lists three:

Code: Select all

user@grill:~$ weather stuttgart
Searching via name...
Your search is ambiguous, returning 3 matches:
   [edds] Stuttgart-Echterdingen, Germany
   [fips0567490] Stuttgart city, AR
   [ksgt] Stuttgart, Stuttgart Municipal Airport, AR, United States
Then I thought: let's check something more common - Paris sounds quite common to me :D Loving the forecast and alert options (yeah, I need the latter quite often~)

edit: can't find the sources of the Chinese Meteorological Institute, sigh. No forecast and alerts for me yet.

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 7:23 pm
by Theo
^ Some of the airports are a bit of a help.
On https://en.wikipedia.org/wiki/List_of_airports_in_China is a list of airports and have 'ICAO' codes.
An example:

theo@theo-System-Product-Name:~$ weather zuck
Searching via station...
[caching result Chongqing, China]
Current conditions at Chongqing, China (ZUCK) 29-31N 106-29E 351M
Last updated Jan 10, 2016 - 01:00 PM EST / 2016.01.10 1800 UTC
Temperature: 46 F (8 C)
Relative Humidity: 93%
Wind: from the NW (320 degrees) at 4 MPH (4 KT)
Weather: light rain; mist
Sky conditions: overcast

Re: weather forecast in terminal

Posted: Sun Jan 10, 2016 7:42 pm
by machinebacon
^ the problem is not the location name, they can be entered by normal city name. What I was referring to is: there are no forecast ("zone-forecast") and alerts for non-US locations on the METAR website.

Re: weather forecast in terminal

Posted: Tue Jan 12, 2016 2:33 am
by noo_b_nomnoms
bbq@hello:~ $ weather lax
Searching via airport...
[caching result Los Angeles Interntl Airport, CA, United States]
Current conditions at Los Angeles Interntl Airport, CA
Last updated Jan 11, 2016 - 07:53 PM EST / 2016.01.12 0053 UTC
Temperature: 59.0 F (15.0 C)
Relative Humidity: 53%
Wind: from the WSW (240 degrees) at 8 MPH (7 KT)
Sky conditions: mostly cloudy

This works nicely!