Timezone Measures (WebParser) - Also called by the Main Skin. I want this to update only ONCE when the skin in updated - since it is TIME I am not really that concerned with it updating all the time. Yes, on the DAYS that Daylight Savings Time changes I understand unless I force an update the timezones could be off. Would this be better to be 86400 for "once a day"?
As described in the Rainmeter documents, update cycle of the WebParser measure is defined as Update X UpdateDivider X UpdateRate = "how often the measure connects to the site".
So in your case, update cycle is 1000*1200*1200 = 1440000000 msec = 1440000 seconds = about 40 hours. sorry mistake, = 400 hours = about 17 days.
I think UpdateDivider=-1 works as you intend, the measure is updated at only skin refresh.
Surely jsmorley has stated as the "UpdateRate=nnnn" value can't be -1... But I found UpdateRate=-1 in the sample code of tips for Network Skin of the Rainmeter documents...What is this? Typo?!
mak_kawa wrote: ↑June 23rd, 2020, 9:32 am
Hi balala and ms310
Surely jsmorley has stated as the "UpdateRate=nnnn" value can't be -1... But I found UpdateRate=-1 in the sample code of tips for Network Skin of the Rainmeter documents...What is this? Typo?!
Yes, that really is a typo, and I will fix it. That should be UpdateDivider=-1
In fact, if you want to have a WebParser measure update once when the skin loads/refreshes, but not again, you CAN use UpdateRate=-1, and it will have that effect. If you instead use UpdateDivider=-1, that will have exactly the same result.
However, UpdateDivider=-1 does fly in the face of the often-given advice to NEVER use UpdateDivider on a WebParser measures, but rather to control the rate that it is updated with UpdateRate. Remember that the ONLY purpose of any "update" to to a WebParser measure is to increment the counter inside of WebParser that is set by UpdateRate. Nothing is going to happen until the value of UpdateRate is reached by the counter and it resets to zero.
In a strictly technical sense, UpdateRate=-1 is not supported. This is due to the fact that the type of number used for the counter inside of WebParser does not support negative numbers. However, due to a quirk of the C language, what happens when you use a negative number with UpdateRate is that it circles around the universe of numbers and you end up with it seeing the value as the maximum value for a 32bit integer, which is just a gigantic number. So the net effect is that WebParser will update once, and then not again for something like 132 years... This does no harm, and for all practical purposes it works as intended. You are pretty likely to reboot your system sometime in the next 132 years.
So I'm torn on the advice to give. I have often said that you should stay completely away from UpdateDivider on WebParser measures, as with the nature of the relationship between UpdateDivider and UpdateRate, it only risks causing "lag", and adds no benefit. On the other hand, UpdateRate=-1, while more or less having the desired effect, is technically an error.
In a technically correct sense, you should probably use UpdateRate=604800 or some other huge number to get WebParser to update only once. With that number, it will update once a week. UpdateDivider=-1, while being technically correct, can cause some confusion with the general advice about UpdateDivider and WebParser.
So either way I guess. Personally, I lean toward UpdateRate=-1. This is because I am always hesitant to use or recommend UpdateDivider on WebParser, and the -1 bit is sorta logical and easy to remember, since it is the same value you would use for this effect with UpdateDivider.
You are likely to see somewhat conflicting advice on this in various places in the forums and documentation, as it was only recently that I realized that UpdateRate=-1 would actually work more or less as intended, and wasn't just a flat-out error. Besides that, which way I lean on this question kinda depends on which side of the bed I got up on this morning. Fortunately, it is very seldom indeed that you want a WebParser measure to only go out to the resource one time.
Whew.. I thought I had lost it there for a while as I use the UpdateRate=-1 on few "Once and Done" URL's I was just about to change them. Thanks for the clarification.