Hi there,
I'm looking for a way to monitor a website, or a part of it, to be more precise. This link will get you to a website which shows all geocaches in a chosen country. In the top left you can see words "Total records" and a number beside it (currently is 878, but this can change any time). This is the number I would like to show on my desktop and if possible get some sort of alert every time the number changes.
Can this be done using rainmeter?
Thanks for the help!
It is currently April 27th, 2024, 4:35 pm
Monitor a (part of) the website
-
- Posts: 16
- Joined: January 2nd, 2017, 11:04 pm
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Monitor a (part of) the website
Use WebParser Measure. Maybe following code works for exmple.
This code monitors "Total Records" every 60 seconds. And if the number is changed, alerts by red text color. Mouse click changes back text color to black and opens the webpage.
Hope I don't misunderatand.
Code: Select all
[Rainmeter]
Update=1000
BackgroundMode=2
SolidColor=192,192,192
[Variables]
GeoURL=https://www.geocaching.com/seek/nearest.aspx?country_id=207&as=1&ex=0&cFilter=9a79e6ce-3344-409c-bbe9-496530baf758&children=n
[GeoMeasure]
Measure=Webparser
URL=#GeoURL#
RegExp=(?siU)Total Records: <b>(.*)</b>
StringIndex=1
OnChangeAction=[!SetOption GeoMeasure OnChangeAction "[!SetOption GeoMeter FontColor 255,0,0]"]
UpdateRate=60
[GeoMeter]
Meter=String
MeasureName=GeoMeasure
W=120
Text=Total Number: %1
LeftMouseUpAction=[!SetOption GeoMeter FontColor 0,0,0][#GeoURL#]
Hope I don't misunderatand.
-
- Posts: 16
- Joined: January 2nd, 2017, 11:04 pm
Re: Monitor a (part of) the website
Yes, you understood correctly what I'm trying to achieve, but the code doesn't work. It just say's Total Number: %1mak_kawa wrote:Use WebParser Measure. Maybe following code works for exmple.This code monitors "Total Records" every 60 seconds. And if the number is changed, alerts by red text color. Mouse click changes back text color to black and opens the webpage.Code: Select all
[Rainmeter] Update=1000 BackgroundMode=2 SolidColor=192,192,192 [Variables] GeoURL=https://www.geocaching.com/seek/nearest.aspx?country_id=207&as=1&ex=0&cFilter=9a79e6ce-3344-409c-bbe9-496530baf758&children=n [GeoMeasure] Measure=Webparser URL=#GeoURL# RegExp=(?siU)Total Records: <b>(.*)</b> StringIndex=1 OnChangeAction=[!SetOption GeoMeasure OnChangeAction "[!SetOption GeoMeter FontColor 255,0,0]"] UpdateRate=60 [GeoMeter] Meter=String MeasureName=GeoMeasure W=120 Text=Total Number: %1 LeftMouseUpAction=[!SetOption GeoMeter FontColor 0,0,0][#GeoURL#]
Hope I don't misunderatand.
-
- Posts: 16
- Joined: January 2nd, 2017, 11:04 pm
Re: Monitor a (part of) the website
Oh, and I get the Error: Webparser is not valid in [GeoMeasure]
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Monitor a (part of) the website
Hi SophieR.
Ah...weird. Above code says "Total Number: 879" on my desktop. Your Rainmeter version is 4.0.0? Any error on Rainmeter log?
If your Rainmeter is 3.X, try to change "Measure=Webparser" to
Ah...weird. Above code says "Total Number: 879" on my desktop. Your Rainmeter version is 4.0.0? Any error on Rainmeter log?
If your Rainmeter is 3.X, try to change "Measure=Webparser" to
Code: Select all
Measure=Plugin
Plugin=Webparser
-
- Posts: 16
- Joined: January 2nd, 2017, 11:04 pm
Re: Monitor a (part of) the website
Yay, it works! Thank you mak_kawa!
Now I'm wondering if there is a way to play a sound alert, when the change happens?
Now I'm wondering if there is a way to play a sound alert, when the change happens?
-
- Posts: 908
- Joined: December 30th, 2015, 9:47 am
Re: Monitor a (part of) the website
First you have to prepare suitable sound (wav) file, for example "chime.wav". And modify following two lines as:
This code keeps up playing chime.wav until mouse click.
Code: Select all
OnChangeAction=[!SetOption GeoMeasure OnChangeAction "[!SetOption GeoMeter FontColor 255,0,0][PlayLoop chime.wav]"]
LeftMouseUpAction=[PlayStop][!SetOption GeoMeter FontColor 0,0,0][#GeoURL#]
-
- Posts: 16
- Joined: January 2nd, 2017, 11:04 pm
Re: Monitor a (part of) the website
Great, you are the best. Thanks for the help!
Is it OK if I put .wav file in the folder next to the .ini file? Or should I put it in the @resources folder instead?
I have one more issue with this. I changed some of the code, here is what I have now:
The issue is that a part of the text is hidden and I can't get it to show (see the attachment). How can I sort this out? I tried changing the width, but it doesn't work...
Is it OK if I put .wav file in the folder next to the .ini file? Or should I put it in the @resources folder instead?
I have one more issue with this. I changed some of the code, here is what I have now:
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=11
[GeoMeasure]
Measure=Plugin
Plugin=Webparser
URL=#GeoURL#
RegExp=(?siU)Total Records: <b>(.*)</b>
StringIndex=1
OnChangeAction=[!SetOption GeoMeasure OnChangeAction "[!SetOption GeoMeter FontColor 255,0,0][PlayLoop chime.wav]"]
UpdateRate=60
[GeoMeter]
Meter=String
MeasureName=GeoMeasure
W=120
StringAlign=CENTER
FontColor=#FontColor#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
Text=Number of Geocaches: %1
LeftMouseUpAction=[PlayStop][!SetOption GeoMeter FontColor 0,0,0][#GeoURL#]
The issue is that a part of the text is hidden and I can't get it to show (see the attachment). How can I sort this out? I tried changing the width, but it doesn't work...
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Monitor a (part of) the website
When using StringAlign=Center, you should always set the X value to 1/2 your W value.
Try:I usually add SolidColor=0,0,0,1 to any string meters that have mouse actions; this makes the entire meter react to the mouse and not just the letters. It is also a good habit to add DynamicWindowSize=1 to the [Rainmeter] section; this will expand the skin to automatically fit the contents.
Try:
Code: Select all
[GeoMeter]
Meter=String
MeasureName=GeoMeasure
X=100
W=200
StringAlign=CENTER
FontColor=#FontColor#
FontSize=#FontHeight#
FontFace=#FontName#
AntiAlias=1
Text=Number of Geocaches: %1
LeftMouseUpAction=[PlayStop][!SetOption GeoMeter FontColor 0,0,0][#GeoURL#]
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 16
- Joined: January 2nd, 2017, 11:04 pm
Re: Monitor a (part of) the website
Thanks for the tips eclectic-tech, altought I have been using Rainmeter for a while now, I'm still a noob when it comes to making changes...
I guess it's all sorted now, just have to wait for a number to change, to see if all works and plays as it should...
I guess it's all sorted now, just have to wait for a number to change, to see if all works and plays as it should...