Based on Weather.com
Includes an APIKey retrieval skin and a WeatherComJSON setting skin that can be added to any weather skin using WeatherComJSON files developed on the Rainmeter Forum.
V1.2023.03.29
- Simplified Auto-location (Thanks Mordasius!)
- Corrected webparser error messages display
- APIKey can be saved to variables and copied to clipboard
But I digress. In your AutoLocation skin you use https://ipapi.co/json to get the city, region and country identifers which are then passed to https://nominatim to get the Latitude and Longitude for use in the Weatherview.ini skin. In my case this gives latitude and longitude cordinates which are again within 3km of where I live and quite close enough for a weather skin but my question is why do you use the https://nominatim site when you can get what what you need from the original ipapi.co/json search?
But I digress. In your AutoLocation skin you use https://ipapi.co/json to get the city, region and country identifers which are then passed to https://nominatim to get the Latitude and Longitude for use in the Weatherview.ini skin. In my case this gives latitude and longitude cordinates which are again within 3km of where I live and quite close enough for a weather skin but my question is why do you use the https://nominatim site when you can get what what you need from the original ipapi.co/json search?
The quick answer is that I borrowed and combined code from several sources to obtain an auto-location and didn't look at optimization.
I will revisit this to see if it can be simplified. If both sites return the same values for latitude and longitude it may be possible to eliminate the nominatim parsing.
EDIT: I also use https://www.mapcoordinates.net/ as an alternative to both sites to manually obtain the latiude and longitude values. Can you have too many methods to find locations ?
eclectic-tech wrote: ↑March 28th, 2023, 1:16 pm
If both sites return the same values for latitude and longitude it may be possible to eliminate the nominatim parsing.
They don't return exactly the same coordinates but https://ipapi.co/json is actually better in my case which means I can use your [MeasureLocationbyIP] modified as follows to get everything I need.
Mordasius wrote: ↑March 28th, 2023, 7:12 amThe ipapi.co/json search you use to identify the location from the IP address returns a latitude / longitude within 3km of where I actually live which is far better than some other sites.
It surely is better (and lighter) than the alternatives you mentioned (about the same as https://whatismyip.live/ for IPv6), but in my case the coordinates are 45 km of where I live, thus not exactly a good fit for weather. Of course, I doubt there is a perfect fit anyway, when it comes to free and common folk usable alternatives. Automating this is a nice thing to have, however nothing beats the manual setting of such coordinates.
eclectic-tech wrote: ↑March 28th, 2023, 1:16 pm I also use https://www.mapcoordinates.net/ as an alternative to both sites to manually obtain the latiude and longitude values. Can you have too many methods to find locations ?
No you can't have too many sites and what is special about https://www.mapcoordinates.net/ is that it also gives the elevation above sea level which is a requirement for super-accurate Prayer Times. If only someone knew a way to scape the site.....
Yincognito wrote: ↑March 28th, 2023, 2:24 pm
It surely is better (and lighter) than the alternatives you mentioned (about the same as https://whatismyip.live/ for IPv6)
Yes this is another goodie for your location from IPv6 which gives the time zone and is easily scaped.
Thanks for the code... I will have some time later today or tomorrow to update the skin with this and perhaps an option as suggested by Yincognito.
Accurate "Automatic Locating" is a pipe dream, but offering as many options as possible to the end user should let them make the skin as accurate as possible (within the limits of weather.com's station locations).
eclectic-tech wrote: ↑March 28th, 2023, 2:52 pm... perhaps an option as suggested by Yincognito.
Well, I don't know about suggesting something, I was merely reflecting that such a site might give for someone (e.g. Mordasius) a 3 km range and for another (e.g. me) a 50 km one - ipapi.co and whatismyip.live are exactly the same in that regard for me, by the way, they both give a location at 45 km from where I live.
Other than that, I like how fast and detailed is ipapi.co - I would have probably changed my current ident.me site that I use for IPv4/IPv6 detection to it in my network skin, if only ipapi.co provided an IPv4 address to begin with (I display both v4 and v6 addresses, along with the used protocol, so not only the address for the used protocol).
Updated to V1.2023.03.29
- Simplified Auto-location (Thanks Mordasius!)
- Corrected webparser error messages display
- APIKey retrieval can be saved to the JSON variables file and copied to clipboard
Auto-locating will use your ISP location which can be anywhere from a few kilometers or nearly 75 kilometers away from your actual location.
The skin offers an internet map lookup of your location latitude and longitude (then copy and paste) or by entering the values directly in the settings skin.
Oops. The [mTimeZonebyIP] I posted above has a dud Substitute string that will not pick up the correct TimeZone for the many places that have a xx30 UTC offset (India, Nepal, Afganistan, Iran, parts of Australia, etc.). The correct version is: