chubin / wttr.in

:partly_sunny: The right way to check the weather
https://wttr.in
Apache License 2.0
24.53k stars 1.1k forks source link

One-line mode shows coordinates instead of City, Country format #265

Closed devbis closed 5 years ago

devbis commented 5 years ago

Hi!

After #264 is fixed (thanks for the fast fix!) I suppose it is better to display the current city in the one-line mode for auto-detected location. Full mode display correct city

$ curl "wttr.in/?0"
Weather report: St Petersburg, Russia

               Overcast
      .--.     -9--2 °C
   .-(    ).   ← 26 km/h
  (___.__)__)  10 km
               0.0 mm

but in one-liners, I can see only coordinates

$ curl "wttr.in/?format=4"
59.938732,30.316229: ☁️ 🌡️-2⁰C 🌬️←26 km/h

The label for predefined location is used from the query:

$ curl "wttr.in/Saint-Petersburg,Russia,PREDEFINED_TEST?format=4"
Saint-Petersburg,Russia,Predefined_Test: ☁️ 🌡️-2⁰C 🌬️←26 km/h
chubin commented 5 years ago

It should work now, please test.

$ curl wttr.in/?format=3
Brussels: 🌫 +3⁰C
$ curl wttr.in/Brussels?format=3
Brussels: 🌫 +3⁰C

And in other location types it is displayed properly now:

$ curl wttr.in/@hermitage.ru?format=3
St Petersburg, Russia: 🌨 -4⁰C
$ curl wttr.in/@kremlin.ru?format=3
Moscow, Russia: 🌨 -4⁰C
$ curl wttr.in/@vrn.ru?format=3
Voronezh, Russia: 🌫 -5⁰C

And even in the cyclic location specification (for tmux and other status lines), everything works fine:

$ curl wttr.in/@vl.ru:@vrn.ru?format=3
Voronezh, Russia: 🌫 -5⁰C
$ curl wttr.in/@vl.ru:@vrn.ru?format=3
Vladivostok, Russia: ☀️ -21⁰C

(is the cyclic notation documented, by the way? I believe, it is not)

devbis commented 5 years ago

Awesome! Thanks again for the fast fix! Now it works great.