It is currently March 28th, 2024, 6:32 pm

Monitor a (part of) the website

General topics related to Rainmeter.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Monitor a (part of) the website

Post by eclectic-tech »

Always happy to help!
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Monitor a (part of) the website

Post by mak_kawa »

Hi SophieR.

If the code is "[PlayLoop chime.wav]", you have to locate the sound file in same folder to the ini file. But if you locate it in @Resources folder, the code must be as "[PlayLoop #@#chime.wav]".
SophieR
Posts: 16
Joined: January 2nd, 2017, 11:04 pm

Re: Monitor a (part of) the website

Post by SophieR »

Tested it today and it works like a charm. :thumbup:

Can it be modified a bit more, to alert me only when the total number goes up (and not when it drops)?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Monitor a (part of) the website

Post by balala »

SophieR wrote:Can it be modified a bit more, to alert me only when the total number goes up (and not when it drops)?
A very simple solution: you need a measure which returns the largest value achieved so far:

Code: Select all

[MeasureMax]
Measure=Calc
Formula=( Max ( GeoMeasure, MeasureMax ))
The value returned by this measure will change only when the value returned by the [GeoMeasure] measure goes up.
The last thing you need is an OnChangeAction, to check when the value of the [MeasureMax] measure is changing:

Code: Select all

[MeasureMax]
Measure=Calc
Formula=( Max ( GeoMeasure, MeasureMax ))
OnChangeAction=[PlayLoop chime.wav]"]
SophieR
Posts: 16
Joined: January 2nd, 2017, 11:04 pm

Re: Monitor a (part of) the website

Post by SophieR »

Great, thank you!

So, I assume I have to remove OnChangeAction from GeoMeasure?

Like that:

Code: Select all

[GeoMeasure]
Measure=Plugin
Plugin=Webparser
URL=#GeoURL#
RegExp=(?siU)Total Records: <b>(.*)</b>
StringIndex=1
UpdateRate=60

[MeasureMax]
Measure=Calc
Formula=( Max ( GeoMeasure, MeasureMax ))
OnChangeAction=[!SetOption GeoMeasure OnChangeAction "[!SetOption GeoMeter FontColor 255,0,0][PlayLoop chime.wav]"]
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Monitor a (part of) the website

Post by balala »

SophieR wrote:So, I assume I have to remove OnChangeAction from GeoMeasure?
Yeah, obviously.
SophieR
Posts: 16
Joined: January 2nd, 2017, 11:04 pm

Re: Monitor a (part of) the website

Post by SophieR »

After a few days of testing, I must say the last change doesn't work as intended. The numbers are constantly changing (up and down) and I'm still alerted on every change, not only when the counter goes up.

Here is the code I'm currently using:

Code: Select all

[Rainmeter]
Update=1000

[Variables]
GeoURL=https://www.geocaching.com/seek/nearest.aspx?country_id=207&as=1&ex=0&cFilter=9a79e6ce-3344-409c-bbe9-496530baf758&children=n

FontColor=255,255,255,255
FontName=Open Sans
FontHeight=10

[GeoMeasure]
Measure=Plugin
Plugin=Webparser
URL=#GeoURL#
RegExp=(?siU)Total Records: <b>(.*)</b>
StringIndex=1
UpdateRate=60

[MeasureMax]
Measure=Calc
Formula=( Max ( GeoMeasure, MeasureMax ))
OnChangeAction=[!SetOption GeoMeasure OnChangeAction "[!SetOption GeoMeter FontColor 255,227,117][PlayLoop chime.wav]"]

[MeterGeoImage]
Meter=IMAGE
ImageName=geo.png
X=0
Y=0
W=35
H=35
LeftMouseUpAction=[PlayStop][!SetOption GeoMeter FontColor 255,255,255,255][#GeoURL#]
SolidColor=0,0,0,1

[GeoMeter]
Meter=String
MeasureName=GeoMeasure
X=262
Y=8
W=500
StringAlign=RIGHT
StringCase=UPPER
StringStyle=BOLD
FontColor=#FontColor#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
Text=Total Number: %1
LeftMouseUpAction=[PlayStop][!SetOption GeoMeter FontColor 255,255,255,255][#GeoURL#]
SolidColor=0,0,0,1
Any help, please? :oops:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Monitor a (part of) the website

Post by balala »

SophieR wrote:After a few days of testing, I must say the last change doesn't work as intended. The numbers are constantly changing (up and down) and I'm still alerted on every change, not only when the counter goes up.
Ok, I have to test your code for a while. I hope I'll come back soon.
SophieR
Posts: 16
Joined: January 2nd, 2017, 11:04 pm

Re: Monitor a (part of) the website

Post by SophieR »

Thank you.

To get faster results, maybe try switching to some other country that has more active caching community. Germany for instance. The numbers should be changing faster there. Replace this part of the code:

Code: Select all

https://www.geocaching.com/seek/nearest.aspx?country_id=207&as=1&ex=0&cFilter=9a79e6ce-3344-409c-bbe9-496530baf758&children=n
with this:

Code: Select all

https://www.geocaching.com/seek/nearest.aspx?country_id=79&as=1&ex=0&cFilter=9a79e6ce-3344-409c-bbe9-496530baf758&children=n
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Monitor a (part of) the website

Post by balala »

Replace the OnChangeAction option of the [MeasureMax] measure, with the following: OnChangeAction=[PlayLoop #@#alarm.wav] or OnChangeAction=[!SetOption GeoMeter FontColor [color=#FF0000]"[/color]255,227,117[color=#FF0000]"[/color]][PlayLoop #@#alarm.wav].
Don't forget the quotation marks around the color code (marked red above), because the color code, although that is composed by three (or four) numbers, is a string, so it requires those marks.
If you apply this solution, when you refresh the skin, the sound will start playing. Stop it, clicking any of the [MeterGeoImage] or the [GeoMeter] meter. This is occurring because initially (before the [GeoMeasure] measure return the value) the value of [MeasureMax] measure is 0, but this will be increased once the [GeoMeasure] measure returns a not zero value.
After this, the sound will be played just when the value returned by the [GeoMeasure] measure, increase.
Post Reply