Page 1 of 2

Webparser Blank Space

Posted: August 14th, 2017, 11:27 am
by VRArt1
I'm working on a skin for retrieving some patreon values and because of the way the website is formatted it has resulted in a lot of empty spaces. How do I change this so that it won't include the blanks in the strings? Or from the regexp; which ever way gets rid of them.

Site: https://graphtreon.com/creator/chapotraphouse

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=1
SolidColor=0,0,0,0

[Metadata]
Name=Patreon Count
Author=
Information=
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

;Accounts

[Graph Account]
Measure=Plugin
Plugin=WebParser
URL=https://graphtreon.com/creator/chapotraphouse
UpdateRate=600
RegExp=(?siU)<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>(.*)</h5>.*<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>(.*)</h5>

FinishAction=[!EnableMeasureGroup Measures][!UpdateMeasureGroup Measures]

;Strings

[Patreon Number]
Measure=Plugin
Plugin=WebParser
URL=[Graph Account]
StringIndex=1
Disabled=1
Group=Measures

[Patreon Pay]
Measure=Plugin
Plugin=WebParser
URL=[Graph Account]
StringIndex=2
Disabled=1
Group=Measures

;Chart

[MeterTitle]
Meter=String
MeasureName=
X=0
Y=10R
FontSize=14
FontColor=255,255,255,255
FontFace=Century Gothic
StringStyle=Normal
Text="Patrons					Per Month"
AntiAlias=1

[MeterPatreon]
Meter=String
MeasureName=Patreon Number
MeasureName2=Patreon Pay
X=0
Y=10R
FontSize=14
FontColor=255,255,255,255
FontFace=Century Gothic
StringStyle=Normal
Text="%1						%2"
AntiAlias=1

Re: Webparser Blank Space

Posted: August 14th, 2017, 12:15 pm
by FreeRaider

Re: Webparser Blank Space

Posted: August 14th, 2017, 12:17 pm
by VRArt1
I've been looking through but I can't find out how to remove the blank spaces. That's why I came back here.

Re: Webparser Blank Space

Posted: August 14th, 2017, 12:34 pm
by FreeRaider

Code: Select all

(?siU)<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>\X+(\d+.*)\s+</h5>.*<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>\X+(\d+.*)\s+</h5>

Re: Webparser Blank Space

Posted: August 14th, 2017, 12:44 pm
by VRArt1
FreeRaider wrote:

Code: Select all

(?siU)<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>\X+(\d+.*)\s+</h5>.*<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>\X+(\d+.*)\s+</h5>
Just tried putting that in and it doesn't seem to be working.

I got an error message of:
RegExp error at offset 109: support for \P, \p, and \X has not been compiled

Re: Webparser Blank Space

Posted: August 14th, 2017, 1:04 pm
by FreeRaider
VRArt1 wrote:Just tried putting that in and it doesn't seem to be working.

I got an error message of:
RegExp error at offset 109: support for \P, \p, and \X has not been compiled

Uhm, I will report that.

Another solution:

Code: Select all

RegExp=(?siU)<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>.*(\d+\,\d+)\s+</h5>.*<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>.*(\d+\,\d+)\s+</h5>

Re: Webparser Blank Space

Posted: August 14th, 2017, 11:14 pm
by VRArt1
FreeRaider wrote:RegExp error at offset 109: support for \P, \p, and \X has not been compiled

Uhm, I will report that.

Another solution:

Code: Select all

RegExp=(?siU)<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>.*(\d+\,\d+)\s+</h5>.*<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>.*(\d+\,\d+)\s+</h5>
Getting a RegExp -1 error for that. Does it work for you?

Re: Webparser Blank Space

Posted: August 15th, 2017, 3:07 am
by eclectic-tech
VRArt1 wrote:Getting a RegExp -1 error for that. Does it work for you?
I used FreeRaider's RegExp in your originally posted code and it returns the values of patrons and pay per month.
patrons.png
You may have a hung webparser... shutdown Rainmeter and restart. If that doesn't correct the error, reboot and it will work.

Re: Webparser Blank Space

Posted: August 15th, 2017, 3:22 am
by VRArt1
eclectic-tech wrote:I used FreeRaider's RegExp in your originally posted code and it returns the values of patrons and pay per month.patrons.pngYou may have a hung webparser... shutdown Rainmeter and restart. If that doesn't correct the error, reboot and it will work.
I just tried it and it worked for me as well, I guess the problem is that the actual goal account is https://graphtreon.com/creator/VRArt1. I just figured it'd work universally but for some reason that's not being the case... What's different between these two that is causing one to work and no the other?

Re: Webparser Blank Space

Posted: August 15th, 2017, 3:57 am
by VRArt1
Here's what the code currently looks like and it's getting the regexp -1 error.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
BackgroundMode=1
SolidColor=0,0,0,0

[Metadata]
Name=Patreon Count
Author=V--R
Information=
Version=1.0.0
License=Creative Commons Attribution - Non - Commercial - Share Alike 3.0

;Accounts

[Graph Account]
Measure=Plugin
Plugin=WebParser
URL=https://graphtreon.com/creator/vrart1
UpdateRate=600
RegExp=(?siU)<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>.*(\d+\,\d+)\s+</h5>.*<div class="col-md-3 col-sm-3 headerstats">.*<div class="box box-solid">.*<div class="box-body">.*<h5>.*(\d+\,\d+)\s+</h5>

FinishAction=[!EnableMeasureGroup Measures][!UpdateMeasureGroup Measures]

;Strings

[Patreon Number]
Measure=Plugin
Plugin=WebParser
URL=[Graph Account]
StringIndex=1
Disabled=1
Group=Measures

[Patreon Pay]
Measure=Plugin
Plugin=WebParser
URL=[Graph Account]
StringIndex=2
Disabled=1
Group=Measures

;Chart

[MeterTitle]
Meter=String
MeasureName=
X=0
Y=10R
FontSize=14
FontColor=255,255,255,255
FontFace=Century Gothic
StringStyle=Normal
Text="Patrons						Per Month"
AntiAlias=1

[MeterPatreon]
Meter=String
MeasureName=Patreon Number
MeasureName2=Patreon Pay
X=0
Y=10R
FontSize=14
FontColor=255,255,255,255
FontFace=Century Gothic
StringStyle=Normal
Text="%1						$%2"
AntiAlias=1