It is currently May 1st, 2024, 10:49 pm

WebParser Problem

Get help with creating, editing & fixing problems with skins
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

WebParser Problem

Post by magges »

Hello everyone,

I currently try to use the WebPaser with the jDownloader.

Thats what RainRegExp is giving me:

Code: Select all

(?siU)<div name="ladebalken" class="running" style="width:(.*);" id=

01=>  44%
02=>  100%
And here is my code:

Code: Select all

[MeasureDownload]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10
Url=http://JD:JD@127.0.0.1:8765
RegExp="(?siU)<div name="ladebalken" class="running" style="width:(.*);" id="
Debug=1

[Download1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureDownload]
StringIndex=1

[Meter1]
METER=STRING
MeasureName=Download1
FontColor=255, 255, 255
Prefix="Test: "
AntiAlias=1
Text=%1

The problem is, my Meter doesn't show me anything. It only shows "Text:", nothing else.
I tried to change Text=%1 to Text="%1", but nothing changed.

I hope you guys can help me to solve that problem, so I can get into WebParser.


greetings
magges
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

magges wrote:Hello everyone,

I currently try to use the WebPaser with the jDownloader.

Thats what RainRegExp is giving me:

Code: Select all

(?siU)<div name="ladebalken" class="running" style="width:(.*);" id=

01=>  44%
02=>  100%
And here is my code:

Code: Select all

[MeasureDownload]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10
Url=http://JD:JD@127.0.0.1:8765
RegExp="(?siU)<div name="ladebalken" class="running" style="width:(.*);" id="
Debug=1

[Download1]
Measure=Plugin
Plugin=Plugins\WebParser.dll
URL=[MeasureDownload]
StringIndex=1

[Meter1]
METER=STRING
MeasureName=Download1
FontColor=255, 255, 255
Prefix="Test: "
AntiAlias=1
Text=%1

The problem is, my Meter doesn't show me anything. It only shows "Text:", nothing else.
I tried to change Text=%1 to Text="%1", but nothing changed.

I hope you guys can help me to solve that problem, so I can get into WebParser.


greetings
magges
Try adding DynamicWindowSize=1 to the [Rainmeter] section of your skin.
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

That worked perfectly, thank you
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

Glad to help.
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

Hey,

I got another Problem. Its working as i want, but there is a problem with the StringIndex's which can't be solved i guess.


First of all, how it works:
Screenshot

The problem:
Screenshot


Is there a way to "reserve" StringIndex's ?

Because when I don't have 5 packages (downloads), it doesn't show me anything, because (and ofcause) the StringIndex doesn't match correctly.


I hope you understand my problem :)

greetings
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

I'm not 100% sure I understand, but I suspect you are going to need to look at this:

http://rainmeter.net/cms/Tips-LookAhead
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

As you can see in Screenshot 1, where it shows everything correctly, the StringIndex is the follow:

Code: Select all

1 = Package 1 Name
2 = Package 1 %
3 = Package 1 Size
4 = Package 2 Name
5 = Package 2 %
3 = Package 2 Size
....
13 = Package 5 Name
14 = Package 5 %
15 = Package 5 Size

When I delete a package, that I only have 4 packages, it destroys everything completly, cause the Index stops at 12 (package 4).

Now that I dont have the String 13-15 I get this error:

Code: Select all

WebParser.dll: [MeasureDownload] Machting error! (-8)
and the whole thing looks like it is in the 2nd screenshot. (No names or anything of package 1-4, just the progression bars).

Code: Select all

[MeasureDownload]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10
Url=http://JD:JD@127.0.0.1:8765
RegExp="(?siU)#Get##Get##Get##Get##Get#"

Code: Select all

Get=.*return popup\(this,600,200\)">(.*)</A>.*<span class="ladestatus">(.*)\((.*)\)

I hope you can understand it now :)
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

Right, and the lookahead assertions can fix that. It isn't about "StringIndexes". The problem is that your entire regular expression is failing, as it can't find all the matches you are asking for, and no StringIndexes at all are created. Using lookahead assertions in regular expression, you can have it just return null (empty) strings for the cases where you ask for 5 things and there are only 4 (for instance) and although you may get empty meters, it won't just fail as it is now.
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

Oh okay, then I misunderstood you this time :) Thanks alot
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

Hey again,

when I try to read reddit or facebook feeds i get the follow error:

Code: Select all

WebParser.dll: (1634) The URL does not use a recognized protocol (ErrorCode=12006)
When I use the same URL in a skin of WP7 or sth it works and I can't see what they did different in their script.

This is the reddit feed e.g.

RainRegExp works perfectly with the given url's, rainmeter doesn't.


greets