wttr.in
wttr.in copied to clipboard
Improve IP-based geolocation
I guess it should return weather data according to the location it got from ip??
Its returing
Weather report: not found
But While passed with location (that too fetched from ip) it returns correct weather
It is possible that it works when you specify your location manually. It just means that the service can't detect your location based on your IP address.
Can you please verify that it is exactly this problem?
$ curl ifcfg.me
# to get your IP as it is visible from outside
$ curl wttr.in/@<YOUR_IP>
If it returns not-found again, the problem is exactly what I meant. If it resolves your location, though, it means there should be a bug.
Please check.
🞈 curl wttr.in/@{myip} Weather report: not found
This is the output
Okay, then everything is as expected. Anyway, thank you for reporting, and I hope that we will increase the quality of our IP-based geolocation in the future. Stay tuned.
Tuned as ever
Yeah, I've been getting "not found" location as well, and it's the same thing (if I call it with my IP specifically, it still returns not found).
IpInfo's location service seems to work (thanks @nariox). In PowerShell, this will work (except that it produces text talking about a specific address in the center of my local city):
irm "wttr.in/$((irm ipinfo.io/json).loc)"
To make it generic, you can use the city/region/country properties from ipinfo, like:
irm "wttr.in/$(irm ipinfo.io/json|%{$_.city,$_.region,$_.country})"
I was also having the same situation while on a college campus. My ugly hack is to use this command instead:
curl -sS wttr.in/$(curl -sS ipinfo.io/json | jq -r '.loc')