Hi
I'm trying to create a skin which reads a list of names and urls from text file, this bit is fairly easy however I need to be able to add and remove items from the text file and have the web parser create the correct amount of string meters.
I followed the lookahead assertions guide, but I don't want to have a meter when I have no value. If I have 10 text items I want 10 string meters.
I have searched around but i'm not sure how to accomplish this.
Thanks
Jarl.
It is currently April 25th, 2024, 1:25 pm
Dynamic list from webparser
-
- Posts: 2
- Joined: April 17th, 2014, 12:29 pm
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Dynamic list from webparser
If you want to have up to 10 text items, then you really will need 10 child WebParser measures and 10 meters. You can set any or all of the meters to Hidden=1, and use an IFMatch on the child measures to look for "" being returned by the measure. If that is false, unhide the corresponding meter, if it is true, hide it.jarlrmai wrote:Hi
I'm trying to create a skin which reads a list of names and urls from text file, this bit is fairly easy however I need to be able to add and remove items from the text file and have the web parser create the correct amount of string meters.
I followed the lookahead assertions guide, but I don't want to have a meter when I have no value. If I have 10 text items I want 10 string meters.
You really can't easily have WebParser (or anything else) "create" meters on the fly.
-
- Posts: 79
- Joined: April 12th, 2014, 12:52 pm
- Location: Slovakia
Re: Dynamic list from webparser
You must create something like this :
[Variables]
Get=(?(?=.*"time">).*"time">(.*)</span>
That means : search string "time" (?(?=.*"time">)
If find it, continue .*"time">(.*)</span> ........
If not , do nothing .
Then in RegExp you can use many #GET# .... RegExp=(?siU)#Get##Get##Get#
[Variables]
Get=(?(?=.*"time">).*"time">(.*)</span>
That means : search string "time" (?(?=.*"time">)
If find it, continue .*"time">(.*)</span> ........
If not , do nothing .
Then in RegExp you can use many #GET# .... RegExp=(?siU)#Get##Get##Get#
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Dynamic list from webparser
Correct, but really not what he is asking though. He gets that part.pds wrote:You must create something like this :
[Variables]
Get=(?(?=.*"time">).*"time">(.*)</span>
That means : search string "time" (?(?=.*"time">)
If find it, continue .*"time">(.*)</span> ........
If not , do nothing .
Then in RegExp you can use many #GET# .... RegExp=(?siU)#Get##Get##Get#
-
- Posts: 1740
- Joined: November 13th, 2012, 9:53 pm
Re: Dynamic list from webparser
you could do this by having one skin that has only the measures and then use a batch file or probably Lua to overwrite a second skin that has only the meters.
but seriously: that's pretty pointless.
but seriously: that's pretty pointless.
-
- Posts: 305
- Joined: August 14th, 2009, 8:04 am
Re: Dynamic list from webparser
You could use Lua and and regex to parse the file, then plug in #*CRLF*# (which will render as a line break in Rainmeter) between each line in one very long variable.
Source: Experience messing around with my notes skin.
Source: Experience messing around with my notes skin.
-
- Posts: 2
- Joined: April 17th, 2014, 12:29 pm
Re: Dynamic list from webparser
Thanks for your replies. I will have a look.