It is currently May 27th, 2020, 3:36 am

Covid-19 Remake

Post your work-in-progress and completed skins to share and discuss.
mak_kawa
Posts: 644
Joined: December 30th, 2015, 9:47 am

Re: Covid-19 Remake

Post by mak_kawa »

Hi iQeem

I suppose that you want to display Update time as your local time? If so...

The update time of the virusncov.com seems to be shown in the time zone of +7 (of SE Asia?). To convert it to your local time, your time zone value is needed.
Sample code for Netherland is as follows. You can integrate this code to your skin, but take care of the consistency especially in measure name.

Code: Select all

[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192,192

[Variables]
Country=netherlands
tZone=0
LocalTimeName=CEST

[MeasureOverall]
Measure=WebParser
URL=https://virusncov.com/covid-statistics/#Country#/
RegExp=(?siU)<i class="recordLed live">.*<small>(.*)</small>.*Total Cases: <strong>(.*)</strong>.*<strong class="red-text">(.*)</strong>.*<strong class="red-text">(.*)</strong>.*Deaths/ Total Cases: (.*)</small>.*<strong class="green-text">(.*)</strong>.*Recovered/ Total Cases: (.*)</small>

[MeasureUpdated]
Measure=WebParser
URL=[MeasureOverall]
StringIndex=1
Substitute="":"Updating...","Last updated:":""," UTC+7":""

[UpdateTime]
Measure=Time
TimeStamp=[MeasureUpdated]
TimeStampFormat=%Y-%m-%d %H:%M:%S
DynamicVariables=1

[UpdateWindowsTime]
Measure=Calc
Formula=([UpdateTime:Timestamp]+((#tZone#-7)*60*60))
DynamicVariables=1

[ConvertUpdateTime]
Measure=Time
TimeStamp=[UpdateWindowsTime]
Format=%Y-%m-%d %H:%M:%S #LocalTimeName#
DynamicVariables=1

[MeterUpdated]
Meter=String
MeasureName=MeasureUpdated
MeasureName2=ConvertUpdateTime
Text=%1#CRLF#%2