It is currently March 29th, 2024, 7:32 am

Url that is just the end of the url for WebParser

Get help with creating, editing & fixing problems with skins
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Url that is just the end of the url for WebParser

Post by JpsCrazy »

Simply stated, there's <a href="/showsudoku.asp?date=20100801&diff=1&post=Y"> in what I would like to parse, to get the correct url for the day.

How could I include the beginning of the url (http://www.brainbashers.com) with that (/showsudoku.asp?date=20100801)?
(As in it should read http://www.brainbashers.com/showsudoku.asp?date=20100801 so I can use it for the next WebParser measure.)

I remember reading awhile ago about a situation like this, but can't find it.

What I have so far:

Code: Select all

[msWebsiteToday]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=http://www.brainbashers.com/today.asp
RegExp="(?siU)<a href=/"/showsudoku.asp(.*)/">.*<a href=/"/showsudoku.asp(.*)/">.*<a href=/"/showsudoku.asp(.*)/">.*<a href=/"/showsudoku.asp(.*)/">.*<a href=/"/showsudoku.asp(.*)/">.*<a href=/"/showsudoku.asp(.*)/">"
UpdateRate=3600

[msWebsiteTodayVeryEasy]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=[msWebsiteToday]
StringIndex=1

[msWebsiteTodayEasy]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=[msWebsiteToday]
StringIndex=2

[msWebsiteTodayMedium]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=[msWebsiteToday]
StringIndex=3

[msWebsiteTodayHard]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=[msWebsiteToday]
StringIndex=4

[msWebsiteTodayVeryHard]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=[msWebsiteToday]
StringIndex=5

[msWebsiteTodayInsane]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=[msWebsiteToday]
StringIndex=6

[msWebsitePrefix]
Measure=Plugin
Plugin=Plugins/WebParser.dll
Url=http://www.brainbashers.com
UpdateRate=3600
The idea is that the user could select a difficulty. Possibly by having six seperate webparsers, and just activating the one that they would want since DynamicVariables doesn't work with plugins. At worse, just use one of the urls in one webparser.
I was thinking Url=[msWebsitePrefix][msWebsiteTodayInsane] or something similar
And since we're on the topic, sorta, why doesn't dynamic variables work with plugins?
That'd make life wonderful.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Url that is just the end of the url for WebParser

Post by jsmorley »

You probably saw this, which should actually help: http://rainmeter.net/cms/Tips-WebParserImageRelative

The issue with dynamic variables and plugins is a tricky one. It appears that fixing it means starting over with how we do dynamic variables in general, and I don't see it happening anytime soon.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Url that is just the end of the url for WebParser

Post by JpsCrazy »

That's exactly what it was, just didn't realize that's what it was called.
Thanks!
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Url that is just the end of the url for WebParser

Post by JpsCrazy »

kenz0 wrote: Because uses are different in this case, that method is useless, and it has some limits.

1). Url=http://example.com/[Measure].html
You can handle such URL as download URL. However, you cannot parse from this URL as a source. I mean you can only download a file.

2). Url=http://example.com/[Measure1]&[Measure2]&[Measure3].html
You cannot include multiple [Measure] in URL like ↑
So does that mean this won't work?
Yes, I'm trying to parse the new url.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Url that is just the end of the url for WebParser

Post by jsmorley »

Based on the input from kenz0, yes. It looks like it won't work except in the limited way I show in that Tips and Tricks entry where you are "bulding" a url to download an image.
User avatar
JpsCrazy
Posts: 667
Joined: April 18th, 2010, 2:16 pm
Location: NY, USA

Re: Url that is just the end of the url for WebParser

Post by JpsCrazy »

This is a HUGE longshot, but could you possible use that new url to download the source as a .txt file and then parse that?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Url that is just the end of the url for WebParser

Post by jsmorley »

JpsCrazy wrote:This is a HUGE longshot, but could you possible use that new url to download the source as a .txt file and then parse that?
Not as such. You could try debug=2 and define a name to save the raw html as and then use another WebParser with URL=file://, but I doubt it. This is sort of what WebParser does in any case (only to %TEMP%) and I suspect it won't be fooled by this.