Here's the situation: I'm using WebParser to get something I need, however the URL is not a fixed one, but also from another webpage which I'll need to read it using WebParser first.
For example, say I want to show the content of the latest post on some forum, but the URL of that post is not fixed, I will need to obtain it from the forum main page first.
Now here's the problem: WebParser (or any other Plugin) doesn't support dynamic variables! So even if I managed to get the URL string using the first WebParser (say [mURL]), the second WebParser (say [mLastestPost]) is not going to reach for the correct URL even if I use variables in the Url option!
Well, someone may say use our new weapon, !SetOption... but no, it also doesn't work on Plugins!
So here's my method for overcoming the problem.
Code: Select all
[Variables]
URL=...
[mGetURL]
Measure=Plugin
Plugin=WebParser.dll
Url=...
RegExp=....
Disabled=0
FinishAction=!Execute [!Update][!WriteKeyValue Variables "URL" "[mURL]"][!WriteKeyValue mGetURL Disabled 1][!WriteKeyValue mLatestPost Disabled 0][!Refresh]
[mURL]
Measure=Plugin
Plugin=WebParser.dll
Url=[mGetURL]
StringIndex=...
Disabled=0
[mLatestPost]
Measure=Plugin
Plugin=WebParser.dll
Url=#URL#
RegExp=....
Disabled=1
But here comes another question: how do I, say after a period of time, update the URL? Since [mGetURL] is now disabled...
Well, simple! Just setup a counter like this:
Code: Select all
[mRefreshCounter]
Measure=Calc
Formula=mRefreshCounter+1
IfAboveValue=1000
IfAboveAction=!Execute [!WriteKeyValue mGetURL Disabled 0][!WriteKeyValue mLatestPost Disabled 1][!Refresh]
You can also use the same trick with more than one step of infomation getting. For example, in my own skin, I first obtain the URL of a second page from the main page, and then get the URL of a particular image from that second page, and then show that image! Pretty cool, isn't it?
Thanks for reading