It is currently March 29th, 2024, 5:09 am

Question

Get help with creating, editing & fixing problems with skins
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Question

Post by xenium »

Which is the reason that the source code of a web page is being updated with a very long delay(three, four hours ,sometimes and more), although the data on the web page is updated every hour?
Therefore, the skin can not display the correct data.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Question

Post by jsmorley »

xenium wrote:Which is the reason that the source code of a web page is being updated with a very long delay(three, four hours ,sometimes and more), although the data on the web page is updated every hour?
Therefore, the skin can not display the correct data.
As expressed, that is literally not possible. What is displayed on a web page in your browser IS what is there in the "source" of the web page.
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Question

Post by fonpaolo »

If you're talking about WebParser and UpdateRate, it depends on how often the site is updated, in most cases one hour or more is normal.
Depending on this, you can set the update accordingly, I'm using 10 minutes or less just for some forums (only the very active ones).
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Question

Post by xenium »

jsmorley wrote:As expressed, that is literally not possible. What is displayed on a web page in your browser IS what is there in the "source" of the web page.
And yet it happens

On the web page
Capture2.PNG
In the source code
Capture1.PNG
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: Question

Post by balala »

Could you give us the code of the skin (along with the URL), to can check?
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Question

Post by xenium »

balala wrote:Could you give us the code of the skin (along with the URL), to can check?

Code: Select all

[Rainmeter]
Update=1000


[Variables]
UpdateRateSeconds=600
FontFace=arial
URL=http://aqicn.org/city/vancouver/


============================================================

[MeasureValue]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<div class='aqivalue' id='aqiwgtvalue' style=' .* 'title=".*" >(.*)</div>
UpdateRate=#UpdateRateSeconds#
StringIndex=1


[MeasureLevel]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<div class='aqivalue' id='aqiwgtvalue' style=' .* 'title="(.*)" >.*</div>
UpdateRate=#UpdateRateSeconds#
StringIndex=1

[MeasureUpdate]
Measure=WebParser
Url=#URL#
RegExp=(?siU)<span id='aqiwgtutime' val='.*'>(.*)</span>
UpdateRate=#UpdateRateSeconds#
StringIndex=1

==============================================================================================

[MeterValue]
Meter=String
MeasureName=MeasureValue
X=205
Y=272
W=270
H=50
FontColor=255,255,255,255
StringStyle=Normal
StringEffect=SHADOW
FontFace=arial
StringAlign=centercenter
FontEffectColor=0,0,0,80
AntiAlias=1
ClipString=1
FontSize=30
DynamicVariables=1

[MeterLevel]
Meter=String
MeasureName=MeasureLevel
X=205
Y=302
W=270
H=50
FontColor=250,250,250,250
StringStyle=Normal
StringEffect=SHADOW
FontFace=arial
StringAlign=centercenter
FontEffectColor=0,0,0,80
AntiAlias=1
ClipString=1
FontSize=12

[MeterUpdateTime]
Meter=String
MeasureName=MeasureUpdate
X=205
Y=322
W=270
H=50
FontColor=250,250,250,250
StringStyle=Normal
StringEffect=SHADOW
FontFace=arial
StringAlign=centercenter
FontEffectColor=0,0,0,80
AntiAlias=1
ClipString=1
FontSize=10


User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Question

Post by balala »

I'll try to follow what's going on, but for now what is shown on the website and what is in the html code are the same. Let's see how this will change in the near future.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Question

Post by xenium »

balala wrote: for now what is shown on the website and what is in the html code are the same
To me on the website, is displayed "13" and "Updated on Sunday 7:00" and in source code "45" and "Updated on Saturday 23:00" :???:
User avatar
fonpaolo
Moderator
Posts: 1387
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Question

Post by fonpaolo »

This is my first suggestion: why do you use three measures to download all the informations?
Use a measure to download everything you need, then parse the needed strings with other measures using the downloaded information by the first measure.
User avatar
xenium
Posts: 841
Joined: January 4th, 2018, 9:52 pm

Re: Question

Post by xenium »

fonpaolo wrote:This is my first suggestion: why do you use three measures to download all the informations?
Use a measure to download everything you need, then parse the needed strings with other measures using the downloaded information by the first measure.
This is just part of the code to illustrate the problem

The main code uses the parent-child measure structure of the WebParser measures