It is currently March 28th, 2024, 3:35 pm

Webparser Blank Space

Get help with creating, editing & fixing problems with skins
VRArt1
Posts: 10
Joined: August 13th, 2017, 6:32 am

Webparser Blank Space

Post 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
Last edited by VRArt1 on August 15th, 2017, 9:36 am, edited 1 time in total.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Webparser Blank Space

Post by FreeRaider »

VRArt1
Posts: 10
Joined: August 13th, 2017, 6:32 am

Re: Webparser Blank Space

Post 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.
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Webparser Blank Space

Post 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>
VRArt1
Posts: 10
Joined: August 13th, 2017, 6:32 am

Re: Webparser Blank Space

Post 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
User avatar
FreeRaider
Posts: 826
Joined: November 20th, 2012, 11:58 pm

Re: Webparser Blank Space

Post 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>
VRArt1
Posts: 10
Joined: August 13th, 2017, 6:32 am

Re: Webparser Blank Space

Post 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?
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: Webparser Blank Space

Post 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.
VRArt1
Posts: 10
Joined: August 13th, 2017, 6:32 am

Re: Webparser Blank Space

Post 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?
VRArt1
Posts: 10
Joined: August 13th, 2017, 6:32 am

Re: Webparser Blank Space

Post 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
Post Reply