We had always assumed you could not parse a local file on your hard drive with WebParser. Turns out that you in fact can.
Alex2539 discovered that if you use this format:
[MeasureText]
Measure=Plugin
Plugin=Plugins\WebParser.dll
Url=file://C:\Users\YourName\Documents\TextFile.txt
RegExp="(?siU)Stuff to search for(.*)End of Search"
It works just fine and returns values in StringIndexes as with any other WebParser measure.
No "catch" here folks. It just works.
It is currently April 25th, 2024, 4:01 pm
Parsing a local file with WebParser
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
-
- Posts: 1
- Joined: August 10th, 2009, 6:28 pm
Re: Parsing a local file with WebParser
Thanks for posting this! I was just about to ask whether WebParser could handle file:// URLs, as I had thought it should work. Nice to know that it does. Now I'm off to hopefully update my skin layout to take advantage of this
~Jondar
~Jondar
-
- Rainmeter Sage
- Posts: 642
- Joined: July 19th, 2009, 5:59 am
- Location: Montreal, QC, Canada
Re: Parsing a local file with WebParser
I love being mentioned by name I'm anxious to see how everyone handles this newfound feature.
-
- Posts: 61
- Joined: April 22nd, 2009, 7:46 pm
Re: Parsing a local file with WebParser
Wow. Thanks so much for posting this. This has greatly simplified some of my skins. Instead of using 5 different qouteplugin measures, I only need one webparser one.
-
- Posts: 61
- Joined: April 22nd, 2009, 7:46 pm
Re: Parsing a local file with WebParser
It should be mentioned that if UpdateRate is not used on the regexp measure, then the webparser.dll will only update every 10 minutes on the newer versions of Rainmeter. Something kinda useful to know if you need to update the skin every second.
-
- Posts: 146
- Joined: January 8th, 2011, 7:12 pm
- Location: Tennessee
Re: Parsing a local file with WebParser
Could this now be used to do a random quote from a local text file? if so, can you give me an example please? Thank you! };]
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Parsing a local file with WebParser
The QuotePlugin would be better for that.CybOrSpasm wrote:Could this now be used to do a random quote from a local text file? if so, can you give me an example please? Thank you! };]