It is currently May 3rd, 2024, 3:57 pm

WebParser

Get help with creating, editing & fixing problems with skins
WhoGotTheChunk
Posts: 5
Joined: January 14th, 2012, 12:06 am

WebParser

Post by WhoGotTheChunk »

This may just be me being stupid but I dunno. I've struggled with this for a few hours now, googling and reading up on everything I can think of. Basically.

I Parse a server and get 10 results back, I just want to know how to get the 10th one and show it on a simple string meter. I have managed to get the first one back using this code:

Code: Select all

[MeasureName]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
Url=#URL#
RegExp="(?siU)<td class="server-name">(.*)</td>"
StringIndex=1

[MeterName]
Meter=String
MeasureName=MeasureName
X=50
Y=50
W=400
H=400
FontSize=20
FontColor=255,255,255,255
AntiAlias=1
But I would like the 10th one for example. Here are the results from RainRegExp:
Image
If there is any other information that is needed I can provide it.

-Chunk
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: WebParser

Post by Brian »

Regular Expressions in RainRegExp work a little different than in Rainmeter.

In Rainmeter, you need to specify the exact amount of StringIndex's.

So doing RegExp="(?siU)<td class="server-name">(.*)</td>" will only give you one StringIndex. You need to add more (.*)'s to get more StringIndex's.

Try this:

Code: Select all

[Variables]
Get=".*<td class="server-name">(.*)</td>"

[MeasureWeb]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=6000
Url=#URL#
RegExp="(?siU)#GET##GET##GET##GET##GET##GET##GET##GET##GET##GET#"

[MeasureName1]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=1

[MeasureName2]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=2

[MeasureName3]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=3

[MeasureName4]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=4

[MeasureName5]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=5

[MeasureName6]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=6

[MeasureName7]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=7

[MeasureName8]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=8

[MeasureName9]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=9

[MeasureName10]
Measure=Plugin
Plugin=WebParser
Url=[MeasureWeb]
StringIndex=10

[MeterName]
Meter=String
MeasureName=MeasureName1
X=50
Y=50
W=400
H=400
FontSize=20
FontColor=255,255,255,255
AntiAlias=1
As you can see, you need to have a separate "Child" webparser measure for each StringIndex.

Then if you want display the 10th StringIndex, you make a string meter with the MeasureName equal to MeasureName10 (or whatever you want to call your measure containing StringIndex=10).

I hope that makes a little sense.

Here is some more information about Webparser.

-Brian
bernard05120
Posts: 3
Joined: October 27th, 2011, 5:38 pm

Re: WebParser

Post by bernard05120 »

try with
"(?siU)#GET##GET##GET##GET##GET##GET##GET##GET##GET#<td class="server-name">(.*)</td>"

GET=<td class="server-name">.*</td>.*

http://rainmeter.net/cms/Tips-WebParserPrimer
http://rainmeter.net/cms/Tips-GoogleReaderRSS

how well does it work? (exuse me for my bag english)
User avatar
Brian
Developer
Posts: 2689
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: WebParser

Post by Brian »

bernard05120 wrote:try with
"(?siU)#GET##GET##GET##GET##GET##GET##GET##GET##GET#<td class="server-name">(.*)</td>"

GET=<td class="server-name">.*</td>.*

http://rainmeter.net/cms/Tips-WebParserPrimer
http://rainmeter.net/cms/Tips-GoogleReaderRSS

how well does it work? (excuse me for my bag english)
This example works better than mine. After reading the original post, I realized that WhoGotTheChunk is asking to get the 10th server name.

-Brian
WhoGotTheChunk
Posts: 5
Joined: January 14th, 2012, 12:06 am

Re: WebParser

Post by WhoGotTheChunk »

Thank you very much. This helps me out MILLIONS! 1 internet to you both
WhoGotTheChunk
Posts: 5
Joined: January 14th, 2012, 12:06 am

Re: WebParser

Post by WhoGotTheChunk »

I am now getting this in the log:

Code: Select all

WebParser.dll: (1649) The operation timed out (ErrorCode=12002)
I checked the whole WebParser test and I'm getting the green light. I'm just not having any luck with this whole script :(. Tempted to give up and just visit the site everytime lol.

Now running it after restarting I'm getting this in the log:

Code: Select all

WebParser.dll: [MeasureServerName] Matching error! (-8)
WebParser.dll: (1649) The connection with the server was reset (ErrorCode=12031)