It is currently September 16th, 2024, 8:25 pm
Weather Skins Not Working
-
- Posts: 3
- Joined: July 29th, 2020, 11:37 pm
Re: Weather Skins Not Working - This is the only allowed thread about this
Using your includes.zip, long-lat, works !! Thank you for your great work, and also to Yincognito for the explanation of his work, and once I understand it enough, will approach learning how to do it. Learning curve by challenges rather than organized learning. Felicitations to you both
-
- Rainmeter Sage
- Posts: 2736
- Joined: March 23rd, 2015, 5:26 pm
Re: Weather Skins Not Working - This is the only allowed thread about this
Maybe others will have better luck, but I have been unable to sniff out anything their API will accept anything other than geocodes, airport codes, or station IDs. It appears their site sends any location search terms to their location point API, which returns one or more geocodes. Oddly, you can use geocodes=<lat>,<long>;<lat>,<long>;<lat>,<long>;<lat>,<long> etc., though I don't see a realistic use-case for that. I don't see the new-style placeIDs or legacy location codes anywhere, which makes a drop-in replacement includes slightly less hands-free. If you need a site that has a great geocoding and has very generous usage terms, openstreetmap.org is a good choice.jsmorley wrote: ↑July 30th, 2020, 2:31 pm It is my intention to make some fundamental changes to how the .inc files get the data, and while at the end of it an author should more or less be able to drop in the new .inc files, I'm still sorting out how the "location" is going to be handled to make it as easy for the final end-user as possible.
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working - This is the only allowed thread about this
It's not odd, that one, and it's very realistic. One of the purposes of getting an "aggregate" response, besides the ability of getting multiple JSON sections in a single response, is to be able to get that data for multiple locations as well. In other words, this makes it possible to have the weather data for multiple locations in a single request. Now for a Rainmeter user, it might not make much sense, but for other users or companies that use weather data, it may make sense to "distribute" the data for each location further down the line, to their clients. Cheaper and simpler for the entity getting the aggregate response, easier for weather.com on the traffic side as well: win-win.SilverAzide wrote: ↑July 30th, 2020, 3:43 pmOddly, you can use geocodes=<lat>,<long>;<lat>,<long>;<lat>,<long>;<lat>,<long> etc., though I don't see a realistic use-case for that.
P.S. It might make sense for a Rainmeter user as well, since he will have to make a single request from the site if he wants to display for example, weather data for multiple locations at the same time in his skin. The reason I chose the aggregated URL form was not that though, but the fact that one can grab multiple JSON sections in one request.
Last edited by Yincognito on July 30th, 2020, 5:18 pm, edited 3 times in total.
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working - This is the only allowed thread about this
Yeah, don't worry - we've all been there, beginners at one point or another. Just have faith in your ability and you'll be fine in no time. Rainmeter is not complicated, but it takes a while to get familiar with the basics.Ballantyne wrote: ↑July 30th, 2020, 3:12 pm Using your includes.zip, long-lat, works !! Thank you for your great work, and also to Yincognito for the explanation of his work, and once I understand it enough, will approach learning how to do it. Learning curve by challenges rather than organized learning. Felicitations to you both
-
- Developer
- Posts: 22745
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Weather Skins Not Working - This is the only allowed thread about this
It is my intention to change my addon skin that searches for location code by city-state / country to use openstreetmap.org to allow searching by any location text the user wants to input. Then I will parse the XML from that to get and write the latitude / longitude to variables to use in the URL. It shouldn't be any more of a pain than finding the location code is now.SilverAzide wrote: ↑July 30th, 2020, 3:43 pm Maybe others will have better luck, but I have been unable to sniff out anything their API will accept anything other than geocodes, airport codes, or station IDs. It appears their site sends any location search terms to their location point API, which returns one or more geocodes. Oddly, you can use geocodes=<lat>,<long>;<lat>,<long>;<lat>,<long>;<lat>,<long> etc., though I don't see a realistic use-case for that. I don't see the new-style placeIDs or legacy location codes anywhere, which makes a drop-in replacement includes slightly less hands-free. If you need a site that has a great geocoding and has very generous usage terms, openstreetmap.org is a good choice.
I have found that pretty much any text that can reasonably zero in on up to 10 locations will work fine with that site. Even just postal code, like 22308 will get you there.
-
- Rainmeter Sage
- Posts: 16549
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather Skins Not Working - This is the only allowed thread about this
This did the trick. On first test this gonna be the solution, from my point of view. Hope didn't talk too early, but it seems it creates a proper substitution. Further tests are definitely required, but many - many thanks for your work.Yincognito wrote: ↑July 30th, 2020, 12:14 am Ok, new "version" of the automated substitute you can use to "decode" all the \uNumber character references in the weather.com source page, so you can see the local language characters properly (in case you go for the main site, that is):Preview:Code: Select all
[Variables] Number=256 NumberMax=1000 Quotient=(#Number#) Result="" Substitute="" Base=16 Iteration=0 [Rainmeter] Update=25 DynamicWindowSize=1 AccurateText=1 ---Measures--- [MeasureConvert] Disabled=1 Group=SubstituteGroup Measure=Calc Formula=(#Quotient#%#Base#) RegExpSubstitute=1 Substitute="^10$":"A","^11$":"B","^12$":"C","^13$":"D","^14$":"E","^15$":"F","^16$":"G","^17$":"H","^18$":"I","^19$":"J","^20$":"K","^21$":"L","^22$":"M","^23$":"N","^24$":"O","^25$":"P","^26$":"Q","^27$":"R","^28$":"S","^29$":"T","^30$":"U","^31$":"V","^32$":"W","^33$":"X","^34$":"Y","^35$":"Z" IfCondition=(#Iteration#<4) IfTrueAction=[!SetVariable Result "[MeasureConvert]#Result#"][!SetVariable Quotient (Trunc(#Quotient#/#Base#))][!SetVariable Iteration (#Iteration#+1)][!UpdateMeasure "MeasureConvert"] IfFalseAction=[!SetOption MeterShowProgress Text """Substitute Number = #Number##CRLF#Substitute Pair = "\\u#Result#":"[\x#Result#]","""][!SetVariable Substitute """#Substitute#"\\u#Result#":"[\x#Result#]","""][!SetVariable Iteration 0][!SetVariable Number (#Number#+1)][!SetVariable Quotient (#Number#+1)][!SetVariable Result ""] IfCondition2=(#Iteration#>=4) && (#Number#<#NumberMax#) IfFalseAction2=[!WriteKeyValue Variables Substitute """#Substitute#""" "#@#UnicodeSubstitute.inc"][!DisableMeasure "MeasureConvert"] IfConditionMode=1 DynamicVariables=1 ---Meter--- [MeterConvert] Meter=STRING X=5 Y=5 FontFace=Consolas FontColor=255,255,255,255 SolidColor=47,47,47,255 FontSize=16 AntiAlias=1 Text="● Click To Build The Substitute ●" LeftMouseUpAction=[!EnableMeasure "MeasureConvert"] DynamicVariables=1 [MeterShowProgress] Meter=STRING X=5 Y=0R FontFace=Consolas FontColor=255,255,255,255 SolidColor=47,47,47,255 FontSize=16 AntiAlias=1 Text=Substitute Pair = #Number##CRLF#Substitute Pair = "\\u#Result#":"[\x#Result#]", DynamicVariables=1 [MeterSeeResults] Meter=STRING X=5 Y=0R FontFace=Consolas FontColor=255,255,255,255 SolidColor=47,47,47,255 FontSize=16 AntiAlias=1 Text="● Click To See The Results File ●" LeftMouseUpAction=["#@#UnicodeSubstitute.inc"] DynamicVariables=1
Unicode Substitute V2.jpg
This version only self-updates the measure during decimal to hexadecimal conversion, but uses instead the fast update rate of the skin to repeat adding substitute pairs to the main substitute. Therefore, unlike the previous version, this one doesn't consume resources or close Rainmeter when bigger Number to NumberMax intervals are chosen. Basically, it can work forever.
P.S. For this to work, you should have a (preferably UCS-2 LE BOM encoded) UnicodeSubstitute.inc file in the Resource folder of the skin.
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working - This is the only allowed thread about this
No problem - I'm glad it worked. Put it to the test as many times as you want, as this will no doubt lead to a better implementation, if by any chance there are still issues with the approach. There shouldn't be however, unlike the V1 code, which indeed worked only for small Unicode intervals.
Too bad I didn't come up with this automated code a couple of years earlier though, when I built my own "decoder substitute" that handled multiple encodings in HTML (something that DecodeCharacterReference doesn't handle), but then, it's not like I manually built that one either - I just used some Notepad++ regex replacements on a wiki list of Unicode characters instead.
P.S. Don't forget to delete the last comma from the sustitute, when using it - I could have bothered with doing that automatically as well, but didn't.
-
- Posts: 63
- Joined: February 11th, 2011, 4:18 pm
- Location: Oklahoma City
Re: Weather Skins Not Working - This is the only allowed thread about this
I am assuming at this point the green dots weather skins (on this thread: https://forum.rainmeter.net/viewtopic.php?f=27&t=34689) no longer apply as "working" weather skins?
Windows 10 Version 20H2 (OS Build 19042.870)
44))Realtime: Windows Defender, McAfee Total Access-Total Protection, Malwarebytes, WiseVector, HMP Alert, UAC Highest Level
OnDemand: Adwcleaner, MRT, Emsisoft EEK
44))Realtime: Windows Defender, McAfee Total Access-Total Protection, Malwarebytes, WiseVector, HMP Alert, UAC Highest Level
OnDemand: Adwcleaner, MRT, Emsisoft EEK
-
- Rainmeter Sage
- Posts: 8153
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Weather Skins Not Working - This is the only allowed thread about this
Shhh...don't tell anyone about it.JohnBurns wrote: ↑July 30th, 2020, 7:20 pm I am assuming at this point the green dots weather skins (on this thread: https://forum.rainmeter.net/viewtopic.php?f=27&t=34689) no longer apply as "working" weather skins?
-
- Rainmeter Sage
- Posts: 16549
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Weather Skins Not Working - This is the only allowed thread about this
Probably it is practically impossible for any single user to test and / or fix all, but yes, you're right. You have to follow jsmorley's advice in order to get them working again (at least for those using the json approach).JohnBurns wrote: ↑July 30th, 2020, 7:20 pm I am assuming at this point the green dots weather skins (on this thread: https://forum.rainmeter.net/viewtopic.php?f=27&t=34689) no longer apply as "working" weather skins?