It is currently February 23rd, 2024, 3:34 am

Translation of weather skin

Get help with creating, editing & fixing problems with skins
aquaxetinez
Posts: 7
Joined: December 10th, 2023, 9:59 pm

Re: Translation of weather skin

Post by aquaxetinez »

weather.com won`t work without API key in WeatherComJSONVariables.inc

so i think they trottle all over free limits:

Free Plan:
Current Weather API: 50 requests per day
Hourly Forecast API: 100 requests per day
Daily Forecast API: 50 requests per day
Historical Weather API: 50 requests per day
User avatar
balala
Rainmeter Sage
Posts: 16007
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Translation of weather skin

Post by balala »

Yincognito wrote: December 12th, 2023, 4:34 am In the other variants from that skin though, the Update is set to 30 instead of 1000 for the animations to work, and that's what is driving taking data from weather.com to that insane interval of 600 × 30 = 18000 ms = 18 seconds, which is not only preposterous (weather doesn't change every 18 seconds, not even on the surface of the Sun, if we disregard flares), but could lead the site to ban either such skins or the Rainmeter's WebParser plugin header as a whole from accessing the site or the JSON. Just 1000 users of those variants would make up roughly 5000000 requests per day...
Good point, which I didn't realize at a first look. :thumbup:
Additionally still sustain none of the skins of that package is working. Am I mistaking something? Do those skins work?
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Translation of weather skin

Post by Yincognito »

aquaxetinez wrote: December 12th, 2023, 5:32 am weather.com won`t work without API key in WeatherComJSONVariables.inc

so i think they trottle all over free limits:

Free Plan:
Current Weather API: 50 requests per day
Hourly Forecast API: 100 requests per day
Daily Forecast API: 50 requests per day
Historical Weather API: 50 requests per day
Actually, the system in that skin - and many others - won't work without an API key, since they retrieve data exclusively from the JSON itself. Such a key is not needed if getting data from the webpage as an alternative.

But that's not the point, updating weather every 18 seconds is and would be considered an abuse and have the very real potential to negatively affect the overwhelming majority of Rainmeter users that grab stuff from weather.com anyway, irrespective of the free limits on paper.

This behavior must be corrected by that skin's designer (and others who might make such probably unintentional mistakes in their skins) so that the rest of us don't have to pay for their mistakes in the future, and it's very easy to do so...

- in each .ini variant of the skin:

Code: Select all

[Variables]
Update=<DesiredUpdate>
@Include...=...WeatherComJSONVariables.inc
...

[Rainmeter]
Update=#Update#
...
- in the ...WeatherComJSONVariables.inc file:

Code: Select all

...
UpdateRate=(1000/#Update#*<DesiredUpdateRate>)
...
The above would let the skin designer freely set the update value as an .ini specific variable to be used in the corresponding option from [Rainmeter], while also being able to change the update rate as needed AND keep the corresponding variable at the same value regardless of the update value.

In other words, if 600 is used for <DesiredUpdateRate> above, then any .ini variant would retrieve weather data once every 10 minutes, irrespective of whether the update of that .ini is 1000, 30 or otherwise - assuming the UpdateRate formula has the above form. It's easy, flexible and light on the source site at the same time and it would be irresponsible not to be implemented in such case.

Do as you wish, but if you're not, folks will probably come here all sad in the future that they can't get data from weather.com anymore, because of a few instances where the code was improperly written to avoid excessive polling of sites, and the answer will most likely be "I told you so". :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Translation of weather skin

Post by Yincognito »

balala wrote: December 12th, 2023, 3:30 pm Good point, which I didn't realize at a first look. :thumbup:
Additionally still sustain none of the skins of that package is working. Am I mistaking something? Do those skins work?
I only briefly tested an Update=30 variant from that package, but yeah, it didn't work for me either - I mentioned this detail earlier as well. Didn't bother to test the other variants and I wouldn't recommend it to anyone (at least not before it's corrected), given the downright disaster inviting polling for weather data in all but one variant from that skin. :uhuh:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16007
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Translation of weather skin

Post by balala »

Yincognito wrote: December 12th, 2023, 6:11 pm I only briefly tested an Update=30 variant from that package, but yeah, it didn't work for me either - I mentioned this detail earlier as well. Didn't bother to test the other variants and I wouldn't recommend it to anyone (at least not before it's corrected), given the downright disaster inviting polling for weather data in all but one variant from that skin. :uhuh:
Right. However my question / comment related to the not-working skin(s) was addressed to aquaxetinez, who seems to get the skins working.
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Translation of weather skin

Post by Yincognito »

balala wrote: December 12th, 2023, 7:32 pm Right. However my question / comment related to the not-working skin(s) was addressed to aquaxetinez, who seems to get the skins working.
Ah, alright, my bad, just tried to explain everything everywhere, I often attempt that, lol. Until the OP clarifies how or what is actually working on his end, I guess the answer is going to be a mystery, so we'll just have to wait for him to reveal it... :???:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
aquaxetinez
Posts: 7
Joined: December 10th, 2023, 9:59 pm

Re: Translation of weather skin

Post by aquaxetinez »

https://forum.rainmeter.net/viewtopic.php?t=39617

You need to change API key to this one, have no idea where did they get it, but with new API key this weather widget works.

API located in WeatherComJSONVariables.inc
User avatar
balala
Rainmeter Sage
Posts: 16007
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Translation of weather skin

Post by balala »

aquaxetinez wrote: December 12th, 2023, 7:48 pm You need to change API key to this one, have no idea where did they get it, but with new API key this weather widget works.
Right, now I got it working.
aquaxetinez wrote: December 10th, 2023, 10:02 pm Trying to translate weather status, where i need to put this to work? Already tried all files
Did you try applying SilverAzide's idea?
aquaxetinez
Posts: 7
Joined: December 10th, 2023, 9:59 pm

Re: Translation of weather skin

Post by aquaxetinez »

Trying to implement @CurrentConditionsShort right now, but still work in progress)
User avatar
Yincognito
Rainmeter Sage
Posts: 6781
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Translation of weather skin

Post by Yincognito »

aquaxetinez wrote: December 12th, 2023, 8:12 pm Trying to implement @CurrentConditionsShort right now, but still work in progress)
Just so you know, like SilverAzide alluded to as well, the short texts are made of occasional abbreviations and stripping off various letters for that purpose, and they might not always be what you want in a skin, unless for personal use and being familiar with those abbreviations yourself. The medium texts could be a better option if you prefer not having to decipher what stuff means in more extreme cases, but of course, that's up to you.

Even so, these short and medium forms are usually available only for English and might depend on localization. I was confronted with these particularities myself in my skins (where space is at a premium by design), and eventually decided to just use a marquee system and slide the normal texts to make sure things work and are intelligible in every possible scenario that a user would be in. One drawback with doing that would be a slight increase in the CPU usage of the skin, depending on its size and various other factors specific to animating things in a skin.

It's your decision, I just thought you should know this before trying it, just to avoid any surprises going forward. :)
Last edited by Yincognito on December 12th, 2023, 8:56 pm, edited 1 time in total.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth