It is currently July 8th, 2024, 6:41 pm

Weather Skins Not Working

Get help with creating, editing & fixing problems with skins
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5445
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Weather Skins Not Working

Post by eclectic-tech »

It appears they have blocked access to the site. This is what is returned when I set Debug=1 in the skin measure:
Access blocked

Access blocked

You have been blocked because you have violated the
<a href="https://operations.osmfoundation.org/policies/nominatim/">usage policy</a>
of OSM's Nominatim geocoding service. Please be aware that OSM's resources are
limited and shared between many users. The usage policy is there to ensure that
the service remains usable for everybody.

Please review the terms and make sure that your
software adheres to the terms. You should in particular verify that you have set a
<b>custom HTTP referrer or HTTP user agent</b> that identifies your application, and
that you are not overusing the service with massive bulk requests.

If you feel that this block is unjustified or remains after you have adopted
your usage, you may contact the Nominatim system administrator at
nominatim@openstreetmap.org to have this block lifted.
I can access the URL in a browser using https://nominatim.openstreetmap.org/search.php?q=milan%20ohio&format=json, but not through the skin.

Code: Select all

[
    {
        "place_id": 25475756,
        "licence": "Data © OpenStreetMap contributors, ODbL 1.0. http://osm.org/copyright",
        "osm_type": "relation",
        "osm_id": 182931,
        "lat": "41.2975519",
        "lon": "-82.6054547",
        "class": "boundary",
        "type": "administrative",
        "place_rank": 16,
        "importance": 0.39804288436171065,
        "addresstype": "village",
        "name": "Milan",
        "display_name": "Milan, Milan Township, Erie County, Ohio, 44846, United States",
        "boundingbox": [
            "41.2727550",
            "41.3036090",
            "-82.6125120",
            "-82.5822030"
        ]
    }
]
User avatar
balala
Rainmeter Sage
Posts: 16387
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Skins Not Working

Post by balala »

SilverAzide wrote: June 25th, 2024, 11:53 am If you search for "New York, NY", you only get a single search result whereas you used to get the maximum of 10.
SilverAzide wrote: June 25th, 2024, 11:53 am If you search for "New York", you get two results.
Same here in both cases.
SilverAzide wrote: June 25th, 2024, 11:53 am If you search for "San Francisco" or "London" you get 10 results.
Right for San Francisco, however for London I get 7 results: 2 from UK (even if these are practically the same, but there are two results), 2 from Canada and 3 from US.
SilverAzide wrote: June 25th, 2024, 11:53 am I did a search for "Virginia" and I got all sorts of crazy results including some in Arabic, none of which were the US state.
For Virginia I get one single result, from US.
SilverAzide wrote: June 25th, 2024, 11:53 am One caution I did notice while reviewing their API docs, is that their "search.php" URI is (has already been) deprecated and will stop working at some point. Most Rainmeter skins use this. The new URI simply drops the ".php" to conform to REST conventions.
Very good point, many thanks for this detail. Just tried it and it works. I let the URL this way. Thanks again.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2683
Joined: March 23rd, 2015, 5:26 pm

Re: Weather Skins Not Working

Post by SilverAzide »

eclectic-tech wrote: June 25th, 2024, 1:12 pm It appears they have blocked access to the site. This is what is returned when I set Debug=1 in the skin measure:
I can access the URL in a browser using https://nominatim.openstreetmap.org/search.php?q=milan%20ohio&format=json, but not through the skin.
Hi ET,
They are blocking the Rainmeter WebParser, as described here. OSM warned the community they would do this. You need to use a UserAgent string that complies with their terms of service, and does not spoof a browser's UserAgent. Grab the fixed version of the weather.com skin and extract the info from the WeatherComCodes.ini WebParser measure. Based on their TOS and a discussion on Rainmeter's GitHub site, I have switched to, and am recommending others use, the following:

Code: Select all

UserAgent="#ROOTCONFIG#/n.n.n (powered by Rainmeter)"
where "n.n.n" is your skin's version number. For example: UserAgent="#ROOTCONFIG#/1.2.3 (powered by Rainmeter)"
Gadgets Wiki GitHub More Gadgets...
User avatar
Yincognito
Rainmeter Sage
Posts: 7676
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

eclectic-tech wrote: June 25th, 2024, 1:12 pmI can access the URL in a browser
Just saying this for posterity, a smart merger of the WebView and the WebParser plugins would solve a lot of similar issues (and probably create others)... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Thinkr8
Posts: 75
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Weather Skins Not Working

Post by Thinkr8 »

SilverAzide wrote: June 25th, 2024, 4:08 pm I have switched to, and am recommending others use, the following:

Code: Select all

UserAgent="#ROOTCONFIG#/n.n.n (powered by Rainmeter)"
where "n.n.n" is your skin's version number. For example: UserAgent="#ROOTCONFIG#/1.2.3 (powered by Rainmeter)"
Thank you Silverazide, I'm getting a single search result now. It's better than nothing, until or if a future fix will come. :)
Someone said, "Your thinking too much, so I thought more."
User avatar
SilverAzide
Rainmeter Sage
Posts: 2683
Joined: March 23rd, 2015, 5:26 pm

Re: Weather Skins Not Working

Post by SilverAzide »

Thinkr8 wrote: June 25th, 2024, 8:29 pm Thank you Silverazide, I'm getting a single search result now. It's better than nothing, until or if a future fix will come. :)
OK, great.... Just remember, the "future fix" will need to come from OpenStreetMap's end. There's nothing else we can do but cross our fingers and hope. :(
Gadgets Wiki GitHub More Gadgets...
User avatar
Thinkr8
Posts: 75
Joined: November 14th, 2020, 2:36 pm
Location: Washington DC

Re: Weather Skins Not Working

Post by Thinkr8 »

Absolutely, totally understandable. :)
Someone said, "Your thinking too much, so I thought more."
matif
Posts: 3
Joined: September 20th, 2023, 5:19 am

Re: Weather Skins Not Working

Post by matif »

Yincognito wrote: June 20th, 2024, 2:50 pm Sure - regarding ROOTCONFIG:
https://docs.rainmeter.net/manual/variables/built-in-variables/#SkinVariables
The date is just how the versions of JDWS-04 (the skin suite I was talking about earlier) are written by its author, JelleDekkers.

Basically, setting the UserAgent (i.e. the string identifying the browser or program that requests data from a site) to the name of the skin and its version helps in complying to the terms of service from Nominatim / OpenStreetMap, so you can better use their reverse geolocation data in such skins. This happened because some Rainmeter users allegedly abused connecting to Nominatim in the recent past, so sending the details about the program, skin and version connecting to the service helps to block / ban misbehaving skins or those using them.
Thank you! So, I think #ROOTCONFIG# is to load the variables about UserAgent in the root folder of the skin.
User avatar
Yincognito
Rainmeter Sage
Posts: 7676
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Weather Skins Not Working

Post by Yincognito »

matif wrote: July 2nd, 2024, 4:00 am Thank you! So, I think #ROOTCONFIG# is to load the variables about UserAgent in the root folder of the skin.
You're welcome, but nope. #ROOTCONFIG# is a built-in Rainmeter variable that tells you the the name of the root folder of the skin (aka the name of the skin or the suite it belongs to). You then set the UserAgent string to this "name" plus the skin version. That's all there is to it, you don't load any variables in the root folder of the skin, you use variables about the root folder of the skin.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16387
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather Skins Not Working

Post by balala »

Yincognito wrote: July 2nd, 2024, 9:51 am the the name of the root folder of the skin (aka the name of the skin or the suite it belongs to).
Not to nitpick, but the name of the skin and the name of the config are not necessary identical. I'm sure (or even better I know for sure) you know this, so I'm telling this just for those who don't know.