LeftMouseUpAction=[https://weather.com/weather/today/l/#Latitude#,#Longitude#]VClouds wrote: ↑August 2nd, 2020, 10:49 am In my weather skin, when clicking the city name at the top has always opened the city page in the weather.com website.
Using this url: https://weather.com/#Language#/weather/today/l/#LocationCode#
Now after converting to the new Latitude & Longitude method instead of the weather code one, that url obviously does not work anymore.
I know that I can force the user to also enter the location code in addition to the coordinates and that will fix this, but that is something I prefer not to do as it will confuse a lot of my users.
So I wonder if there's some alternative url that uses Latitude & Longitude to open the city page in the weather.com site?
It is currently April 24th, 2024, 11:16 am
⭐ Weather.com - Parsing the V3 JSON
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
-
- Posts: 77
- Joined: April 7th, 2010, 2:34 pm
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Excellent! Thank you!jsmorley wrote: ↑August 2nd, 2020, 11:29 am LeftMouseUpAction=[https://weather.com/weather/today/l/#Latitude#,#Longitude#]
-
- Rainmeter Sage
- Posts: 7154
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
VClouds wrote: ↑August 2nd, 2020, 10:49 am In my weather skin, when clicking the city name at the top has always opened the city page in the weather.com website.
Using this url: https://weather.com/#Language#/weather/today/l/#LocationCode#
Now after converting to the new Latitude & Longitude method instead of the weather code one, that url obviously does not work anymore.
I know that I can force the user to also enter the location code in addition to the coordinates and that will fix this, but that is something I prefer not to do as it will confuse a lot of my users.
So I wonder if there's some alternative url that uses Latitude & Longitude to open the city page in the weather.com site?
Actually, you can do even better. Didn't mentioned it as the Nominatim variant of finding your latitude and longitude was independent, flexible and didn't require an API key and frankly I didn't try out these URLs until now, but one can do pretty much the same in weather.com:jsmorley wrote: ↑August 2nd, 2020, 11:29 amLeftMouseUpAction=[https://weather.com/weather/today/l/#Latitude#,#Longitude#]
Code: Select all
https://api.weather.com/v3/location/search?query=Fort Hunt&locationType=city&language=en-CA&format=json&apiKey=<ApiKey>
Code: Select all
https://api.weather.com/v3/location/search?query=Fort Hunt, Virginia, United States&locationType=address&language=en-CA&format=json&apiKey=<ApiKey>
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Yeah, there are a lot of ways to get the latitude / longitude for a given location.Yincognito wrote: ↑August 2nd, 2020, 12:53 pm Actually, you can do even better. Didn't mentioned it as the Nominatim variant of finding your latitude and longitude was independent, flexible and didn't require an API key and frankly I didn't try out these URLs until now, but one can do pretty much the same in weather.com:or, even more detailed (didn't know jsmorley's home address, so there is more than one result here too, unlike my case which is pretty much unique and outputs a single result):Code: Select all
https://api.weather.com/v3/location/search?query=Fort Hunt&locationType=city&language=en-CA&format=json&apiKey=<ApiKey>
So basically you'll get a JSON with the possible locations, that you can parse and find out the latitude and longitude to use for the main request to the site for the weather JSON.Code: Select all
https://api.weather.com/v3/location/search?query=Fort Hunt, Virginia, United States&locationType=address&language=en-CA&format=json&apiKey=<ApiKey>
This is probably my favorite:
https://forum.rainmeter.net/viewtopic.php?f=118&t=34628&start=530#p180890
As then you can have a link like:
https://www.google.com/maps/search/#Latitude#,#Longitude#
in your skin, and it will jump straight to your actual house in Google Maps, confirming that the skin is in fact using the right location.
-
- Rainmeter Sage
- Posts: 7154
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Yep, but it just occured to me that I might have misunderstood VClouds' question in the first place...
-
- Rainmeter Sage
- Posts: 7154
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Indeed.jsmorley wrote: ↑August 2nd, 2020, 12:59 pm Yeah, there are a lot of ways to get the latitude / longitude for a given location.
This is probably my favorite:
https://forum.rainmeter.net/viewtopic.php?f=118&t=34628&start=530#p180890
As then you can have a link like:
https://www.google.com/maps/search/#Latitude#,#Longitude#
in your skin, and it will jump straight to your actual house in Google Maps, confirming that the skin is in fact using the right location.
-
- Posts: 77
- Joined: April 7th, 2010, 2:34 pm
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
Yes, I just needed a simple weather.com link that uses the lat and long coordinates that are already present in the variables file to display the user's city weather.Yincognito wrote: ↑August 2nd, 2020, 1:02 pm Yep, but it just occured to me that I might have misunderstood VClouds' question in the first place...
jsmorley provided exactly what I was looking for.
But thanks for trying to help.
-
- Rainmeter Sage
- Posts: 7154
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
I have added .inc files for up to 15 days of "Pollen forecasts"
WeatherComJSONPollen.inc
WeatherComJSONPollen10Day.inc
WeatherComJSONPollen7Day.inc
WeatherComJSONPollen5Day.inc
WeatherComJSONPollen3Day.inc
This forecasts values for Grass / Tree / Ragweed pollen levels.
I also corrected an issue with WeatherComJSONAlerts.inc that would produce an error in the log if there were no current alerts on the site.
Get the new .rmskin in the first post of this tread.
WeatherComJSONPollen.inc
WeatherComJSONPollen10Day.inc
WeatherComJSONPollen7Day.inc
WeatherComJSONPollen5Day.inc
WeatherComJSONPollen3Day.inc
This forecasts values for Grass / Tree / Ragweed pollen levels.
I also corrected an issue with WeatherComJSONAlerts.inc that would produce an error in the log if there were no current alerts on the site.
Get the new .rmskin in the first post of this tread.
-
- Posts: 7
- Joined: April 17th, 2016, 7:38 am
Re: ⭐ Weather.com - Parsing the V3 JSON - NEW!
I was looking at the new Pollen files and noticed that the UserAgent was for Firefox 78 while my browser was on 79 (I assume jsmorley 's is also updated) and this started me thinking the a variable #userAgent# in the WeatherComJSONVariables.inc file might be a good idea.
Between the expanding number of .inc files, the possibility of a security problem in a specific version of the browser, and just wanting to keep the userAgent up to date with the latest and greatest version being used by the user I think that this might be a way to set up for an easy fix in the future if this problem arose.
in any case I am simply agog and appreciative of al the work and problem solving involved in getting the weather feed up and running. This makes my transition from DarkSky to weather.com much easier and I thank you.
Between the expanding number of .inc files, the possibility of a security problem in a specific version of the browser, and just wanting to keep the userAgent up to date with the latest and greatest version being used by the user I think that this might be a way to set up for an easy fix in the future if this problem arose.
in any case I am simply agog and appreciative of al the work and problem solving involved in getting the weather feed up and running. This makes my transition from DarkSky to weather.com much easier and I thank you.