It is currently March 28th, 2024, 11:25 pm

Weather source - "Simplony" skin

Get help with creating, editing & fixing problems with skins
User avatar
Kywicha
Posts: 14
Joined: June 12th, 2018, 10:27 pm
Location: Metz, Lorraine, France

Re: Weather source - "Simplony" skin

Post by Kywicha »

A charitable soul ? :oops:
User avatar
ikarus1969
Posts: 571
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: Weather source - "Simplony" skin

Post by ikarus1969 »

You are right, it's the #CRLF# that "breaks" the gradient. But not only #CRLF#, every other "Whitespace" like blanks would result in the same behavior. Each "word" in the string get's its own gradient.

As a solution (or workaround) i would use two different meters for the high and low-temperature.

I've uploaded a screenshot and an example code. In the code i changed the gradient color so, that the second color in the first meter is just in betwen the red and blue. This "in-between"-color i used in the second meter as the starting color.

Just have a look if that would be ok for you:
Screenshot Rainmeter Gradient.png

Code: Select all

[MeterDay4High]
Meter=String
MeasureName=MeasureDay4Hi
Text=%1°
StringAlign=Center
; FontColor=241,55,55
FontFace=Arial
FontSize=16
X=342
Y=255
AntiAlias=1
; InlineSetting=GradientColor | 270 | 241,55,55 ; 0.0 | 0,153,255 ; 1.0
InlineSetting=GradientColor | 270 | 241,55,55 ; 0.0 | 120,104,155 ; 1.0
DynamicVariables=1

[MeterDay4Low]
Meter=String
MeasureName=MeasureDay4Low
Text=%1°
StringAlign=Center
; FontColor=0,153,255
FontFace=Arial
FontSize=16
X=342
Y=0R
AntiAlias=1
; InlineSetting=GradientColor | 270 | 241,55,55 ; 0.0 | 0,153,255 ; 1.0
InlineSetting=GradientColor | 270 | 120,104,155 ; 0.0 | 0,153,255 ; 1.0
DynamicVariables=1
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

I know this reply is a bit late, but maybe better later, than never.
Kywicha wrote:Can i combin the ChanceForPrecip in the "Current" RegExp ? Always fail when i try it .. :confused:
Same question for the Mesure5Days ?
Yes, you can. And more than this, it even would be recommended. In his first reply to this thread, SilverAzide explained why:
SilverAzide wrote:Finally, I know this isn't one of your questions or concerns, but this skin is not using WebParser correctly. The skin is making repeated calls to weather.com for nearly every weather attribute, which is not needed and may get your IP banned if you hit the site too frequently. There are 7 calls to the website, but you need only one, as each call is returning the same data every time. You should fetch the data once, then use "child measures" to parse out the data you need.
Absolutely true and correct. In the last posted code, you reduced the number of parent WebParser measures, but there still are three: [MeasureCurrent], [Measure5Days] and [MeasureChanceForPrecip]. Still too much. They aren't needed.
I finished up rewriting a few things, keeping just one parent measure ([MeasureCurrent]). All other WebParser measures (take care, that I also rewrote the WebParser plugin measures as WebParser measures), are child measures of this one. But this step required a rewrote of the RegExp option. I did it.
Please test this code and let me know if it does work for you:

Code: Select all

[MeasureCurrent]
Measure=WebParser
URL=https://wxdata.weather.com/wxdata/weather/local/#Location#?cc=*&unit=#Unit#&dayf=6&locale=fr_FR
RegExp=(?siU)<head>.*<locale>(.*)</locale>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*<loc id="(.*)">.*<dnam>(.*),.*</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<zone>(.*)</zone>.*<cc>.*<lsup>(.*)</lsup>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*</wind>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*<dewp>(.*)</dewp>.*<moon>.*<icon>(.*)</icon>.*<t>(.*)</t>.*</moon>.*<ppcp>(.*)</ppcp>.*<day d="1" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="2" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="3" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="4" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="5" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>
UpdateRate=1800

;-------------------------------------------------------------
;-------------------------------------------------------------

[MeasureTempUnit]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=2

[MeasurePrecip]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=34

[MeasureWindUnit]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=4

[MeasurePressureUnit]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=5

[MeasureLocation]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=8

[MeasureLong]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=10

[MeasureLat]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=11

[MeasureSunUp]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=12

[MeasureSunDown]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=13

[MeasureWeatherTemp]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=17

[MeasureFeelsLike]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=18

[MeasureIndi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=19

[MeasureWeatherIcons]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=20

[MeasurePressureInfo]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=21

[MeasureWindSpeed]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=23
Substitute=#Index#

[MeasureWindDir]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=26
MinValue=0
MaxValue=360

[MeasureHum]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=28

[MeasureVis]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=29

[MeasureUVInd]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=30

[MeasureUVText]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=31

[MeasureDay1]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=35

[MeasureDay1Max]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=36

[MeasureDay1Min]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=37

[MeasureDay1Icon]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=38

[MeasureDay1Indi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=39

[MeasureDay2]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=40

[MeasureDay2Max]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=41

[MeasureDay2Min]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=42

[MeasureDay2Icon]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=43

[MeasureDay2Indi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=44

[MeasureDay3]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=45

[MeasureDay3Max]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=46

[MeasureDay3Min]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=47

[MeasureDay3Icon]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=48

[MeasureDay3Indi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=49

[MeasureDay4]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=50

[MeasureDay4Max]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=51

[MeasureDay4Min]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=52

[MeasureDay4Icon]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=53

[MeasureDay4Indi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=54

[MeasureDay5]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=55

[MeasureDay5Max]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=56

[MeasureDay5Min]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=57

[MeasureDay5Icon]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=58

[MeasureDay5Indi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=59
User avatar
Kywicha
Posts: 14
Joined: June 12th, 2018, 10:27 pm
Location: Metz, Lorraine, France

Re: Weather source - "Simplony" skin

Post by Kywicha »

Thnks Ikarus, had the same idea as u today but i expected an easier solution.
Finally, it's very fine, i only adjust colors bcs datas were "lost" in the background.
Here the "almost" final version : https://ibb.co/kUNeXy (i tink each time i observe the result more than 2 minutes) ;-)

Balala, u deserve a medal :oops:
I only minor the mesure from Hum to UVText (dont know why u major them).
The result is very fine and the code is much cleaner thanks to you ! :thumbup:
First, i would like the region appears in the location like : ORLEANS, Centre-Val de Loire. Possible ?
I observe that the code original is : *<dnam>(.*)</dnam>. --> "ORLEANS, 45, FRANCE"
In my version, he was edited by the autor to : *<dnam>(.*),.*</dnam>. --> "ORLEANS"
Can we change the code to show up only the 2 first datas and change the departement code in the variables file, to show the region in text form ? :uhuh:
Sure... first, put the code back the way it was originally (as you showed in your post). Next, find the [MeasureLocation] measure and add the following:
Code: Select all

RegExpSubstitute=1
Substitute=".*(,.*)":""
(I did not test this, so it might not work. It is trying to trim off the last comma and everything after it.)
This did not works .. Maybe have u another solution ? :confused:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

Kywicha wrote:The result is very fine and the code is much cleaner thanks to you ! :thumbup:
I'm glad. But I'm not sure what you mean by:
Kywicha wrote:I only minor the mesure from Hum to UVText (dont know why u major them).
User avatar
Kywicha
Posts: 14
Joined: June 12th, 2018, 10:27 pm
Location: Metz, Lorraine, France

Re: Weather source - "Simplony" skin

Post by Kywicha »

I only minor the mesure from Hum to UVText (dont know why u major them).
In the original code :
[MeasureHum] was index 27
[MeasureVis] ....... 28
[UVInd] ........ 29
[UVText] .........30

With your new RegExp, u said to substitute by :
[MeasureHum] index 28
[MeasureVis] ....... 29
[UVInd] ........ 30
[UVText] .........31

But this did not works .. i change to the original (27 to 30) and this works. ;-)

I notice that because i only copy the RegExp, i dont subsitute all my WebParser measures by yours because i had add more measures (dewp, humidex index and windchill temp) and dont wanna overwrite datas :D

But the main thing is that the result is there :17good
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

Kywicha wrote:In the original code :
[MeasureHum] was index 27
[MeasureVis] ....... 28
[UVInd] ........ 29
[UVText] .........30

With your new RegExp, u said to substitute by :
[MeasureHum] index 28
[MeasureVis] ....... 29
[UVInd] ........ 30
[UVText] .........31

But this did not works .. i change to the original (27 to 30) and this works. ;-)

I notice that because i only copy the RegExp, i dont subsitute all my WebParser measures by yours because i had add more measures (dewp, humidex index and windchill temp) and dont wanna overwrite datas :D

But the main thing is that the result is there :17good
Yep, it seems you're indeed right and I've mixed something. However I'm glad if you finally got it working well. Good job...
User avatar
Kywicha
Posts: 14
Joined: June 12th, 2018, 10:27 pm
Location: Metz, Lorraine, France

Re: Weather source - "Simplony" skin

Post by Kywicha »

U deserve all the credit cap'tain ;-)
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

Kywicha wrote:U deserve all the credit cap'tain ;-)
Thanks (if you're talking about me).
User avatar
Kywicha
Posts: 14
Joined: June 12th, 2018, 10:27 pm
Location: Metz, Lorraine, France

Re: Weather source - "Simplony" skin

Post by Kywicha »

Hey guys,

New probs :

I included the updatetime to my skin but i knock myself to a problem : hours are in 12h format despite the "locale=fr_FR"
Here the regexp :

Code: Select all

[MeasureCurrent]
Measure=WebParser
URL=https://wxdata.weather.com/wxdata/weather/local/#Location#?cc=*&unit=#Unit#&dayf=6&locale=fr_FR
RegExp=(?siU)<head>.*<locale>(.*)</locale>.*<ut>(.*)</ut>.*<ud>(.*)</ud>.*<us>(.*)</us>.*<up>(.*)</up>.*<ur>(.*)</ur>.*<loc id="(.*)">.*<dnam>(.*)</dnam>.*<tm>(.*)</tm>.*<lat>(.*)</lat>.*<lon>(.*)</lon>.*<sunr>(.*)</sunr>.*<suns>(.*)</suns>.*<zone>(.*)</zone>.*<cc>.*<lsup>(.*)</lsup>.*<obst>(.*)</obst>.*<tmp>(.*)</tmp>.*<flik>(.*)</flik>.*<t>(.*)</t>.*<icon>(.*)</icon>.*<bar>.*<r>(.*)</r>.*<d>(.*)</d>.*<wind>.*<s>(.*)</s>.*<gust>(.*)</gust>.*<d>(.*)</d>.*<t>(.*)</t>.*</wind>.*<hmid>(.*)</hmid>.*<vis>(.*)</vis>.*<uv>.*<i>(.*)</i>.*<t>(.*)</t>.*<dewp>(.*)</dewp>.*<moon>.*<icon>(.*)</icon>.*<t>(.*)</t>.*</moon>.*<ppcp>(.*)</ppcp>.*<day d="1" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="2" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="3" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="4" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.*<day d="5" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>
UpdateRate=1800
I already succeeded to hide the date and the "CEST" by the subsitute :

Code: Select all

Substitute="(\d/\d+/\d+) (\d+:\d+) (\w+) (\w+)":"\2 \3"
but want the 24h format :???:

2nd prob : i want to include min and max of the day in my skin .. i thought it was the exp :

Code: Select all

*<day d="0" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t>.

but always fail when i want to include it in [MeasureCurrent] formula .. idea why ? :(

Thanks in advance !

Pierre