chubin / wttr.in

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

location in one-liners #612

Open giovannicoppola opened 3 years ago

giovannicoppola commented 3 years ago

The one-line output formats that include the location currently return the user input as location name, and (if there is no match) data from either Oymyakon (after curl request) or Ban Not, Vietnam (JSON output).

This can be confusing if the user mistypes the city name, e.g.

curl 'wttr.in/nurremberg?format=4'              
nurremberg: 🌧 🌡️+70°F 🌬️↗2mph`

It would be great to return the location from the data itself, which if I understand correctly is ['nearest_area'][0]['areaName'][0]['value'] in the JSON output.

chubin commented 2 years ago

I agree with your concerns, but on the other hand, sometimes you want to be able to specify the location name in your (still correct) spelling. For example, you could want to see it as Nürnberg and not Nuremberg. I think we should add a special one-line format character, that will display the nearest area, or resolved location name, instead of the location that was specified.