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

WebParser Tester

Get help with creating, editing & fixing problems with skins
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

WebParser Tester

Post by jsmorley »

If you are having problems getting WebParser skins (weather, rss feeds, etc) to work and are not sure that Rainmeter / WebParser is "talking" to the internet properly you can use this tiny little skin to test if Rainmeter is connecting to the internet ok.

Just run this .rmskin. If the lights are green, you are ok. If they are red, there is an issue that needs further investigation.
WebParserTest.rmskin
(32.69 KiB) Downloaded 1821 times
01.jpg
02.jpg
03.jpg
Possible solutions

- Exit and restart Rainmeter
- Restart your computer.
- Check if firewall or router is blocking Rainmeter.
- Proxy server setting incorrectly configured in Windows Internet Explorer.
francescocossiga
Posts: 1
Joined: November 4th, 2013, 11:21 am

Re: WebParser Tester

Post by francescocossiga »

Thanks for sharing good work.
lockhear7
Posts: 1
Joined: January 17th, 2016, 1:41 pm

Re: WebParser Tester

Post by lockhear7 »

Just what I need. Thanks!

Btw quick question about update rates. I have a skin update of 10000ms. I didnt set a value for update rate but i read that it is defaultly set to 600 for safety measures. Will my total update be 10000ms or 10000ms x 600?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Tester

Post by jsmorley »

lockhear7 wrote:Just what I need. Thanks!

Btw quick question about update rates. I have a skin update of 10000ms. I didnt set a value for update rate but i read that it is defaultly set to 600 for safety measures. Will my total update be 10000ms or 10000ms x 600?

10000ms x 600
User avatar
exper1mental
Posts: 269
Joined: January 9th, 2013, 7:52 pm
Location: Clemson University
Contact:

Re: WebParser Tester

Post by exper1mental »

I really like this skin! Now I can get a workaround setup that prevents WebParser from murdering itself trying to lookup webpages offline :p However, there are a few things I can't seem to quite figure out.

When I disconnect my computer from a network, the internet connection and webparser test stay green and the measures do not seem to recognize the loss of internet. I modified the measures and now internet connection goes back to gray when a network is disconnected but I can't seem to figure out how to reset the WebParser no matter what I try... (I'd like to avoid resorting to refreshing the skin if at all possible)

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureNetwork]
Measure=Plugin
Plugin=CheckNet
ConnectionType=Network
UpdateRate=5
IfEqualValue=1
IfEqualAction=[!EnableMeasure MeasureInternet][!EnableMeasure MeasureCheckNetwork]
IfBelowValue=1
IfBelowAction=[!DisableMeasure MeasureInternet][!DisableMeasure MeasureWebParser][!EnableMeasure MeasureCheckNetwork]

[MeasureCheckNetwork]
Measure=Calc
Formula=[MeasureNetwork]
IfEqualValue=0
IfEqualAction=[!SetOption MeterNetworkImage ImageName NoLight.png][!SetOption MeterNetworkText FontColor "150,150,150,255"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterNetworkImage ImageName GreenLight.png][!SetOption MeterNetworkText FontColor "220,252,221,255"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption MeterNetworkImage ImageName RedLight.png][!SetOption MeterNetworkText FontColor "247,143,143,255"][!UpdateMeter *][!Redraw]
DynamicVariables=1
Disabled=1

[MeasureInternet]
Measure=Plugin
Plugin=CheckNet
ConnectionType=Internet
UpdateRate=30
IfEqualValue=1
IfEqualAction=[!EnableMeasure MeasureWebParser][!EnableMeasure MeasureCheckInternet]
IfBelowValue=1
IfBelowAction=[!DisableMeasure MeasureWebParser][!EnableMeasure MeasureCheckInternet]
Disabled=1

[MeasureCheckInternet]
Measure=Calc
Formula=[MeasureInternet]
IfEqualValue=0
IfEqualAction=[!SetOption MeterInternetImage ImageName NoLight.png][!SetOption MeterInternetText FontColor "150,150,150,255"][!UpdateMeter *][!Redraw]
IfAboveValue=0
IfAboveAction=[!SetOption MeterInternetImage ImageName GreenLight.png][!SetOption MeterInternetText FontColor "220,252,221,255"][!UpdateMeter *][!Redraw]
IfBelowValue=0
IfBelowAction=[!SetOption MeterInternetImage ImageName RedLight.png][!SetOption MeterInternetText FontColor "247,143,143,255"][!UpdateMeter *][!Redraw]
DynamicVariables=1
Disabled=1

[MeasureWebParser]
Measure=Plugin
Plugin=WebParser
Url=http://www.msftncsi.com/ncsi.txt
RegExp="^(.*)$"
;UpdateRate=30
ForceReload=1
StringIndex=1
RegExpSubstitute=1
Substitute="^Microsoft NCSI$":"1","":"-1"
ErrorString="-1"
FinishAction=[!EnableMeasure MeasureCheckWebParser]
Disabled=1

[MeasureCheckWebParser]
Measure=Calc
Formula=[MeasureWebParser]
IfEqualValue=0
IfEqualAction=[!SetOption MeterWebParserImage ImageName NoLight.png][!SetOption MeterWebParserText FontColor "150,150,150,255"][!UpdateMeter *][!Redraw][!DisableMeasureGroup Proxy]
IfAboveValue=0
IfAboveAction=[!SetOption MeterWebParserImage ImageName GreenLight.png][!SetOption MeterWebParserText FontColor "220,252,221,255"][!UpdateMeter *][!Redraw][!DisableMeasureGroup Proxy]
IfBelowValue=0
IfBelowAction=[!SetOption MeterWebParserImage ImageName RedLight.png][!SetOption MeterWebParserText FontColor "247,143,143,255"][!UpdateMeter *][!Redraw][!EnableMeasureGroup Proxy]
DynamicVariables=1
Disabled=1

[MeasureProxy]
Measure=Registry
Group=Proxy
RegHKey=HKEY_CURRENT_USER
RegKey=Software\Microsoft\Windows\CurrentVersion\Internet Settings
RegValue=ProxyEnable
UpdateDivider=30
Disabled=1

[MeasureIsProxy]
Measure=Calc
Group=Proxy
Formula=MeasureIsProxy
IfBelowValue=1
IfBelowAction=[!SetOption MeterProxyText Text "WebParser is not able to parse the site at http://www.msftncsi.com.  This could be due to a limited Internet connection, firewall settings, or a problem with connection settings in Windows Internet Explorer."][!ShowMeter MeterProxyText][!UpdateMeter *][!Redraw]
IfEqualValue=1
IfEqualAction=[!SetOption MeterProxyText Text "WebParser is not able to parse the site at http://www.msftncsi.com.  This could be due to a limited Internet connection, firewall settings, or a problem with connection settings in Windows Internet Explorer.#CRLF##CRLF#Note: There seems to be a proxy server defined for Internet Explorer on your system. WebParser can't authenticate on a proxy server if it requires a login. You may be able to correct the issue by unchecking the 'Proxy Server' box in 'Lan Settings' under 'Internet Options' in Internet Explorer."][!ShowMeter MeterProxyText][!UpdateMeter *][!Redraw]
Disabled=1

[MeterBack]
Meter=Image
W=220
H=140
SolidColor=47,47,47,255

[MeterHeader]
Meter=String
W=210
H=30
FontSize=14
FontColor=161,186,220,255
SolidColor=37,37,37,255
Padding=10,10,0,0
AntiAlias=1
Text=WebParser Tester

[MeterNetworkImage]
Meter=Image
ImagePath=#@#Images\
ImageName=NoLight.png
X=10
Y=48
W=24
H=24
AntiAlias=1

[MeterNetworkText]
Meter=String
X=8R
Y=4r
FontSize=11
FontColor=150,150,150,255
AntiAlias=1
Text=Network Connection

[MeterInternetImage]
Meter=Image
ImagePath=#@#Images\
ImageName=NoLight.png
X=10
Y=([MeterNetworkImage:Y] + [MeterNetworkImage:H] + 5)
W=24
H=24
AntiAlias=1

[MeterInternetText]
Meter=String
X=8R
Y=4r
FontSize=11
FontColor=150,150,150,255
AntiAlias=1
Text=Internet Connection

[MeterWebParserImage]
Meter=Image
ImagePath=#@#Images\
ImageName=NoLight.png
X=10
Y=([MeterInternetImage:Y] + [MeterInternetImage:H] + 5)
W=24
H=24
AntiAlias=1
DynamicVariables=1

[MeterWebParserText]
Meter=String
X=8R
Y=4r
FontSize=11
FontColor=150,150,150,255
AntiAlias=1
Text=WebParser Test

[MeterProxyText]
Meter=String
W=210
X=([MeterBack:X] + [MeterBack:W] + 5)
Y=0
FontSize=10
FontColor=255,255,255,255
SolidColor=145,20,22,255
Padding=5,5,5,5
ClipString=2
AntiAlias=1
DynamicVariables=1
Hidden=1
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Tester

Post by jsmorley »

You might take a look at this:

https://docs.rainmeter.net/manual-beta/plugins/webparser/#OnConnectErrorAction

and this:

https://docs.rainmeter.net/manual-beta/plugins/webparser/#CommandMeasureReset

And see if you can't use this to have something in the skin change if a connect error is detected. You WON'T want to use !Refresh with it, as that is certain to cause a fatal endless loop if you don't have an internet connection. In fact, any action at all that forces the WebParser parent measure to update on an error is just the definition of an endless loop.

I haven't given it a lot of thought, as really the point of this skin is to "test" and so doing a refresh of the skin is sorta the best way to do it. It's really not about "monitoring" the connection.

The issue with using WebParser to "monitor" your network / internet connection is that by design WebParser will retain any previous value(s) it had if it can't connect to the remote resource on any given update. It is designed so that if you disconnect your laptop, or your internet is slow, or there is some other "hiccup" in the connection, you don't have news feeds and weather skins and all that just blowing up on you. The assumption is that it is likely that the connection problem is transient, and WebParser just holds on to the previous value while it waits for things to straighten out.

You are really better off using the SysInfo plugin to "monitor" your network connection.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Tester

Post by jsmorley »

exper1mental, something like this is a possibility:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureWebParser]
Measure=Plugin
Plugin=WebParser
Url=http://www.msftncsi.com/ncsi.txt
RegExp=^Microsoft NCSI$
UpdateRate=30
ForceReload=1
RegExpSubstitute=1
Substitute="^Microsoft NCSI$":"1","":"-1"
OnConnectErrorAction=[!SetOption MeasureGotError Formula "1"]

[MeasureGotError]
Measure=Calc
Formula=0
IfAboveValue=0
IfAboveAction=[!CommandMeasure MeasureWebParser "Reset"]

[MeasureTestResult]
Measure=Calc
Formula=[MeasureWebParser]
IfEqualValue=0
IfEqualAction=[!SetOption MeterResult Text "Waiting"][!SetOption MeterResult FontColor "150,150,150,255"][!UpdateMeter *][!Redraw][!SetOption MeasureGotError Formula "0"]
IfAboveValue=0
IfAboveAction=[!SetOption MeterResult Text "WebParser connecting"][!SetOption MeterResult FontColor "220,252,221,255"][!UpdateMeter *][!Redraw][!SetOption MeasureGotError Formula "0"]
IfBelowValue=0
IfBelowAction=[!SetOption MeterResult Text "WebParser not connecting!"][!SetOption MeterResult FontColor "247,143,143,255"][!UpdateMeter *][!Redraw][!SetOption MeasureGotError Formula "0"]
DynamicVariables=1

[MeterResult]
Meter=String
FontSize=15
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
AntiAlias=1
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany
Contact:

Re: WebParser Tester

Post by Active Colors »

Does this skin work for anyone today?
It doesn't light up for internet connection even though my internet is up.
The log is quiet.
Capture.PNG
User avatar
tass_co
Posts: 511
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: WebParser Tester

Post by tass_co »

Active Colors wrote: August 5th, 2022, 7:16 am Does this skin work for anyone today?
It doesn't light up for internet connection even though my internet is up.
The log is quiet.
Capture.PNG
works fine for me :thumbup:
05-08-2022 11_31_21-.png
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Tester

Post by jsmorley »

Works for me...


1.png
Post Reply