ikarus1969 wrote: ↑July 8th, 2019, 12:24 pm
You can use the following code -
please make sure to save it with coding "UTF LE" (UTF Little Endian):
I would be tempted to make the following cosmetic changes, just to have it not show "unfinished" stuff before the site is parsed... Basically, just hide everything until the WebParser parent is done.
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[Metadata]
Author=https://github.com/adelghaenian
[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://calendar.zoznam.sk/persian_calendar-en.php
RegExp=(?siU)<div id="headline21">(.*): (.*)\. (.*) (.*)</div>
FinishAction=[!ShowMeterGroup myMeters][!UpdateMeterGroup myMeters][!UpdateMeter MeterShape][!Redraw]
[MeasureWeekDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=1
Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"
[MeasureDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2
[MeasureYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4
[MeasureMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3
; شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه
Substitute="Farvardin":"1","Ordibehesht":"2","Khordad":"3","Tir":"4","Mordad":"5","Shahrivar":"6","Mehr":"7","Aban":"8","Azar":"9","Dey":"10","Bahman":"11","Esfand":"12"
[Style1]
FontFace=Josefin Sans
FontSize=40
StringStyle=Normal
FontColor=ffffff
AntiAlias=1
Group=myMeters
Hidden=1
[MeterShape]
Meter=Shape
Shape=Rectangle 0.5,0.5,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
MeterStyle=Style1
DynamicVariables=1
[MeterYear]
Meter=String
MeasureName=MeasureYear
X=30
y=18
MeterStyle=Style1
AntiAlias=1
[MeterSplit]
Meter=String
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
Text=/
[MeterMonth]
Meter=String
MeasureName=MeasureMonth
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
[MeterSplit2]
Meter=String
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
Text=/
[MeterDay]
Meter=String
MeasureName=MeasureDay
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
[MeterWeekDay]
Meter=String
MeasureName=MeasureWeekDay
X=[MeterYear:X]
y=0R
MeterStyle=Style1
AntiAlias=1
DynamicVariables=1
Note that I poke that shape meter [MeterShape] twice in the FinishAction, to be sure it is not "one update behind" with the sizing that it is deriving from other meters that come after it. It would be disconcerting to "see" it change size one update after it is all drawn.
One other minor tweak is that if you are going to have a "stroke" on your shape meter, you need to be sure that the entire stroke is contained in the skin. Remember that strokes are the "drawing line" of the shape and not a "border", and are drawn 1/2 "inside" the shape and 1/2 "outside" the shape. So you need to be sure the position allows that 1/2 that is "outside" to be drawn in the skin.
Code: Select all
Shape=Rectangle 0.5,0.5,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
So I just moved the shape in and down 0.5 pixels, or 1/2 of the size of the stroke. StrokeWidth defaults to 1px.
1.png
You do not have the required permissions to view the files attached to this post.