wttr.in
wttr.in copied to clipboard
Wrong temperature reported when `?format=` is used despite specifying the same GPS coordinates
curl 'wttr.in/<GPS coordinates>'
curl 'wttr.in/<same GPS coordinates>?format=%c+%C+%m+%w+%t+%f'
The former reports 24(21) °F and the latter reports ☀️ Clear 🌒 0mph +24°F +20°F. I'm not sure how the "feels like" temperature is not the same (21°F vs 20°F). I've run the commands multiple times at the same time and this is consistent.
UPDATE: Same thing, 3-day weather report shows +44F(41)F for current while formatted one-liner shows +50F(+48F) for current. I am using GPS coordinates to 4 decimal places and %l reports as such. However, when specifying the same coordinates for the weather report, the GPS coordinates are shown to 14 decimal places and shows the my location quite accurately. If I then copy these coordinates back to the one-liner, I'm still getting the same incorrect temperature for the formatted one liner. So it seems parsing the curl one liner is broken.
I am not sure about it. I rather would expect that it is a caching problem, and some of the queries are handled
from the cache, and some are not. To prove it, please append &nonce=$RANDOM to the query, like this:
curl wttr.in/<LOCATION>?format=<FORMAT>&nonce=$RANDOM
curl 'wttr.in/<GPS coordinates>' does not support &nonce=$RANDOM so it's not cached and always accurate?
Anyway, the temperatures are still different--same temperatures are reported below:
curl "wttr.in/<LOCATION>?format=<FORMAT>&nonce=$RANDOM"
and
curl "wttr.in/<LOCATION>?format=<FORMAT>"
I also niticed that temperature is differend from what I see online sometimes 3 degrees
Theoretically, it is possible that the location is resolved to wrong coordinates.
To verify that, specify format=j1 as an argument, and check the coordinates of the nearest_area
Unfortunately &nonce=$RANDOM does not produce the correct output either:
curl "wttr.in/Berlin?Q0&nonce=$RANDOM&lang=de&format=3"
Berlin: ☀️ +20°C
curl "wttr.in/Berlin" | head -n 5
Weather report: Berlin
\ / Sunny
.-. +29(28) °C
― ( ) ― ↖ 9 km/h
I verified that the coordinates are the same. Is there a different way to clear the cache?
Yes I tested that too and still temperature varies alot from 2-4 oC and location is valid.