It is currently April 28th, 2024, 9:51 am

Weather source - "Simplony" skin

Get help with creating, editing & fixing problems with skins
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: Weather source - "Simplony" skin

Post by SilverAzide »

Kywicha wrote:I included the updatetime to my skin but i knock myself to a problem : hours are in 12h format despite the "locale=fr_FR". I already succeeded to hide the date and the "CEST" by the subsitute :
but want the 24h format :???:
The XML feed from weather.com always uses the 12-hour US time and date format for the observation station and last update times. The only times that will be in your locale specific format are the sunrise/sunset times. If you want the dates and times in non-US format, you have to convert them yourself. Use a Time measure, something like this:

Code: Select all

[MeasureLastUpdate]
Measure=Time
TimeStamp=[<enter the name of your measure containing the date and time string>]
TimeStampFormat=%#m/%#d/%y %#I:%M %p
TimeStampLocale=en-US
TimeZone=local
Format=<enter your preferred formatting here>
DynamicVariables=1
Gadgets Wiki GitHub More Gadgets...
User avatar
balala
Rainmeter Sage
Posts: 16183
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

Kywicha wrote: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 ? :(
Yep. Probably you've not properly modified the RegExp option. If it does work, depends where have you added the expression of the current day.
So, I rewrote a bit the incriminated RegExp, modifying it, to return the information for the current day as well. The problem is that this also requires to rewrite the StringIndex options of all child WebParser measures, starting from the StringIndex=34.
Another modification I've made is that I added a DayItem variable, which is in fact the part of the RegExp, related to one day (no matter which day). So, start by adding this variable to the [Variables] section: DayItem=<day d=".*" t="(.*)".*<hi>(.*)</hi>.*<low>(.*)</low>.*<icon>(.*)</icon>.*<t>(.*)</t> (obviously without removing any previously existing variable).
Now modify the WebParser measures, as it follows:

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>.*#DayItem#.*<ppcp>(.*)</ppcp>.*#DayItem#.*#DayItem#.*#DayItem#.*#DayItem#.*#DayItem#
UpdateRate=1800

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

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

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

[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=27

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[MeasureDay5Indi]
Measure=WebParser
Url=[MeasureCurrent]
StringIndex=64
See that in the new RegExp expression, I've used the #DayItem# variable six times (once for the current day and five times for the upcoming days).
The newly added [MeasureDay0], [MeasureDay0Max], [MeasureDay0Min], [MeasureDay0Icon] and [MeasureDay0Indi] measures are returning the appropriate information, for the current day. To show them up, you have to modify the appropriate String meter(s), too and add further measures to show up the icon for the current day. I hope you'll be able to get this to work. Are you?
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 !

I'm such an idiot .. I often checked if someone post but without logging in .. and didnt noticed that there is a 3rd page .. :thumbdown:

SilverAzide, your code works properly :thumbup:
Here, a little preview :
https://ibb.co/mUrreo

balala, i was desperate to fail even after trying several times to re-make it work after replace by your Regexp .. I was going to tell you that it didnt work when i noticed i missed a part : add the variable :oops:

Works nicely :thumbup:
U can check the previous link !

Thanks both cap'tains :great: :thumbup:
I tried to puzzle out the code of WXData by JSMorley but it's so difficult .. I think I'll stop there in the code. Regexp/Measure/Meter is ok for me, i already can do a lot with this :lol:

PS : SilverAzide, i tried to install your skin "gadgets 4.1.0" but i cant .. Error message by windows : Rainmeter 4.2.0.3043 or higher is required to install this package .. the last version of rainmeter isnt 4.1.0 ?! :?
User avatar
balala
Rainmeter Sage
Posts: 16183
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

Kywicha wrote:I'm such an idiot .. I often checked if someone post but without logging in .. and didnt noticed that there is a 3rd page .. :thumbdown:
Don't worry, it happens to all of us sometimes, I think.
Kywicha wrote:balala, i was desperate to fail even after trying several times to re-make it work after replace by your Regexp .. I was going to tell you that it didnt work when i noticed i missed a part : add the variable :oops:

Works nicely :thumbup:
Yep, that variable is important, because it is part of the RegExp. Without it, the WebParser measure definitely can't work. But I'm glad you got it working finally.
Kywicha wrote:PS : SilverAzide, i tried to install your skin "gadgets 4.1.0" but i cant .. Error message by windows : Rainmeter 4.2.0.3043 or higher is required to install this package .. the last version of rainmeter isnt 4.1.0 ?! :?
You can always take a look at the main Rainmeter page, to check which is the latest available version. Right now it is "4.2 Beta Release - r3104". If you'll upgrade, you'll be able to install that package.
User avatar
Kywicha
Posts: 14
Joined: June 12th, 2018, 10:27 pm
Location: Metz, Lorraine, France

Re: Weather source - "Simplony" skin

Post by Kywicha »

Yep, that variable is important, because it is part of the RegExp. Without it, the WebParser measure definitely can't work. But I'm glad you got it working finally.
I understand the value but totally missed this part :confused: :p
I'm just starting to get familiar with the basics .. substitutes are the harder :twisted:
You can always take a look at the main Rainmeter page, to check which is the latest available version. Right now it is "4.2 Beta Release - r3104". If you'll upgrade, you'll be able to install that package.
I always was distrusful of betas .. I'ld waiting for the final :great:
User avatar
balala
Rainmeter Sage
Posts: 16183
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Weather source - "Simplony" skin

Post by balala »

Kywicha wrote:substitutes are the harder :twisted:
Nor those aren't too hard, but you have to get used with them.
Kywicha wrote:I always was distrusful of betas .. I'ld waiting for the final :great:
Don't have to. Rainmeter's betas are stable and the experience shows they can be used without problems.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2613
Joined: March 23rd, 2015, 5:26 pm

Re: Weather source - "Simplony" skin

Post by SilverAzide »

Kywicha wrote:PS : SilverAzide, i tried to install your skin "gadgets 4.1.0" but i cant .. Error message by windows : Rainmeter 4.2.0.3043 or higher is required to install this package .. the last version of rainmeter isnt 4.1.0 ?! :?
Balala is right, you can install the beta without any worries. The Rainmeter developers take great pains to make sure the betas are backward compatible and stable. Give it a try! :thumbup:

P.S.: If you want an older version that works with Rainmeter 4.1.0, you can get it here.
Gadgets Wiki GitHub More Gadgets...