JamX wrote: ↑February 20th, 2020, 10:33 am
1] How do I substitute de DayXName from Fri to Friday?
below code does not work???
Code: Select all
[@ForecastDay1Name]
Measure=WebParser
Group=Weather | WeatherEightDay
Url=[@ForecastParent]
StringIndex=1
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"
As mak_kawa said, a proper Substitute should definitely work. I'm surprised if the above Substitute doesn't work, because it should. For instance the following does work:
Code: Select all
[Rainmeter]
Update=1000
DynamicWindowSize=1
[Variables]
URLtendday=https://weather.com/en-US/weather/tenday/l/ROXX0035
Forecast=(?siU)(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>).*(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*(?(?=.*</td><td class="twc-sticky-col" headers="day" .* className="twc-sticky-col").*><div><div><span class="date-time">(.*)</span>)(?(?=.*<icon class="icon icon-svg icon-svg-.* .* icon-(.*)" className="icon).* icon-svg icon-svg-.* .* icon-.*">.*</icon>)(?(?=.*<div class="twc-table-shadow sticky" className="twc-table-shadow sticky").*></div></div><span class="day-detail clearfix">(.*)</span></div>)(?(?=.*</td><td class="description" .* className="description").*><span>(.*)</span>)(?(?=.*</td><td class="temp" .* className="temp").*><div><span class="">(.*)<sup>(.*)</sup></span>.*<span class="">(.*)<sup>(.*)</sup></span></div>)(?(?=.*</td><td class="precip" .* className="precip").*><div><span class="icon icon-font iconset-weather-data icon-drop-1" className="icon icon-font iconset-weather-data icon-drop-1"></span><span class=""><span>(.*)<span class="Percentage__percentSymbol__2Q_AR">(.*)</span>).*
[MeasureTenDayAll]
Measure=WebParser
Group=Weather
Url=#URLtendday#
RegExp=(?siU)^(.*)$
UpdateRate=600
[MeasureForecastParent]
Measure=WebParser
Group=Weather
Url=[MeasureTenDayAll]
StringIndex=0
RegExp=#Forecast#
LogSubstringErrors=0
[MeasureWeekday1]
Measure=WebParser
Group=Weather
Url=[MeasureForecastParent]
StringIndex=7
Substitute="Mon":"Monday","Tue":"Tuesday","Wed":"Wednesday","Thu":"Thursday","Fri":"Friday","Sat":"Saturday","Sun":"Sunday"
[MeterWeekday]
Meter=STRING
MeasureName=MeasureWeekday1
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=%1
[MeterWeekday] returns right now
Friday instead of
Fri. Done through the Substitute option of the [MeasureWeekday1] measure.
JamX wrote: ↑February 20th, 2020, 10:33 am
2] The windspeed is now returned in xx km/h
I want it to be only xx and then divided by 1.852 to get knots
Let's say the windspeed is returned as xx km/h by the [MeasureWindSpeed] WebParser measure. To get only its numeric value, you have to use a Substitute option, but I'd use a regular expression substitution, adding the following two options to the [MeasureWindSpeed] measure:
Code: Select all
[MeasureWindSpeed]
...
RegExpSubstitute=1
Substitute="(\d*).*":"\1"
Then to divide the value, you need a Calc measure:
Code: Select all
[MeasureWindSpeedKnots]
Measure=Calc
Formula=( MeasureWindSpeed / 1.852 )
If this doesn't work, add brackets around the MeasureWindSpeed measure name into the Formula option of the above measure
AND add a
DynamicVariables=1 option as well:
Code: Select all
[MeasureWindSpeedKnots]
Measure=Calc
Formula=( [MeasureWindSpeed] / 1.852 )
DynamicVariables=1
For first, please check the above replies. Do they work? If don't, please post the whole code of your skin as you have it, or even better pack the whole config and upload the package. When I check, will try to figure out the last two questions as well.