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

WebParser Problem

Get help with creating, editing & fixing problems with skins
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: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
That error generally indicates a typo on your URL= line in WebParser. Ensure that the line starts with "http://"
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

Thats the measure:

[measureFeed]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10
Url=http://www.reddit.com/.rss?feed=338738136d099652566401ab2d52239a24953a80&user=maggges
RegExp="(?siU)#Get##Get##Get##Get##Get#"
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

That works fine for me:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1

[measureFeed]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=10
Url=http://www.reddit.com/.rss?feed=338738136d099652566401ab2d52239a24953a80&user=maggges
RegExp="(?siU)^(.*)$"
Debug=2

[MeterOne]
Meter=String
Make sure you don't have your skin .ini file encoded in some strange format, and you might try copy/pasting the Url= line from here into your skin, so we can eliminate some strange hidden character or something from your .ini file.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

The other thing I would be VERY careful of is hitting any website every 10 seconds. You can end up with WebParser blocked from the site, or even hang WebParser (requiring a restart of Rainmeter) if it is trying to hit a site again when it hasn't finished retrieving all data from the previous request.

There is almost NO website you ever need to hit every 10 seconds.
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

I found my problem... I'm so dumb, may be caused by doing rainmeter since 7 hours :P


In a 2nd measure I had Url=#measureFeed# instead of Url=[measureFeed].

You gave me the solution, cause when I used your script and added the 2nd measure, it didn't work anymore :) Thanks
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:I found my problem... I'm so dumb, may be caused by doing rainmeter since 7 hours :P


In a 2nd measure I had Url=#measureFeed# instead of Url=[measureFeed].

You gave me the solution, cause when I used your script and added the 2nd measure, it didn't work anymore :) Thanks
Glad you got it sorted out. My pleasure.
User avatar
magges
Posts: 14
Joined: February 9th, 2012, 6:07 pm

Re: WebParser Problem

Post by magges »

Hey again ( :? )

I'm now working on sorting out streams from http://clgaming.net/livestreams and its working, but somehow my RegExp stops after 6 Streams.

Code: Select all

SubstituteStream="1.png" : "lol.png", "2.png" : "dota2.png", "/live/" : "http://clgaming.net/live/", "  " : "", "#CRLF#" : "", "viewers" : ""
GetStream=.*/interface/img/game/(.*)".*href="(.*)">(.*)</a>.*<div>(.*)</div>

[mStream]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=300
Url=http://clgaming.net/livestreams
RegExp="(?siU)#GetStream##GetStream##GetStream##GetStream##GetStream##GetStream#"
Debug=1
Thats how it is working (6 times #GetStream#). If I add it again, that it should show me 7 Streams, I get the following Error:

Code: Select all

WebParser.dll: [mStream] Matching error! (-8)
Google told me that it might be something with the way how different RegExp, my Browser and WebParser Plugin reads the quellcode, but I can't really see a difference after 6 Streams...


Can you help me again? :)

so far thanks for the great help :welcome:
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: WebParser Problem

Post by jsmorley »

The first 6 of those patterns you have match and return captured values. I see in the HTML of the site when I look at it that the 7th instance of "/interface/img/game/" is set in code that is completely different, and so your pattern is not matching on that one and the entire thing fails.

I really recommend that you get this: http://rainmeter.net/forum/viewtopic.php?f=18&t=769 and spend some time going through the code one and figuring out what RegExp is going to work for you. Regular expressions take a little bit to wrap your head around, but you are never going to be able to manage this on your own if you don't take a run at really understanding how it works.