Hi, I've got a few websites which I own that I want to keep tabs on how much up / down time they have. I decided doing a simple webparse of the title was easiest and saving result to a text file. I set this up and it works great.
My only problem / niggle with this is that each time the skin is loaded it initially returns a "false" result and then a second later it corrects this to the proper value. I presume it's related to how the webparser runs, if anyone has any suggestions on how to work around this it would be greatly appreciated.
mak_kawa wrote: ↑September 9th, 2020, 8:24 am
The reason is that when the IfMatch evaluation is launched, [WebMeasure] is accessing the site and has no value yet, so IfMatch is failed.
To avoid this, set another measure for IfMatch evaluation, and it is enabled with FinishAction in the [WebMeasure], like as;
I'd add only one option to the above code: an OnConnectErrorAction=[!EnableMeasure WebStatus] option to the [WebMeasure] measure. If you're using only the FinishAction, if the connection fails, the skin won't indicate anything, because you don't get enabled the [WebStatus] measure. With the above OnConnectErrorAction option you do this as well and you'll see the real status of the site, no matter if the site is up or down.
I did test and yes the onconnectionerroraction was needed.
however unless I missed something when altering my code, in my log file it's only registering once on refresh But it's stating "loading..." rather than Down or Good.
ideally it should register current sites actual state
Jimmy401 wrote: ↑September 9th, 2020, 10:01 am
now that it's only triggering once on load, I will probably look at re-writing my lua... perhaps there is a more easier / efficient way to do this.
Please post the current and complete code of your skin.