It is currently April 19th, 2024, 3:38 am

Can't get regex to work, help appreciated

Get help with creating, editing & fixing problems with skins
User avatar
Novadestin
Posts: 21
Joined: August 18th, 2016, 11:36 pm

Can't get regex to work, help appreciated

Post by Novadestin »

Hello, everyone. I fully admit that I have no real understanding of regex, but I've at least managed to make them work on a basic level for a couple of other sites and I did have this one up and running too, but now it seems they've changed things around and I can't figure it out anymore. So, if anyone can explain how to do this and/or why it's not working, it would be really helpful; thank you!

Site: https://www.makestar.co/projects/singer_jeonyoul_02/story

Plan: To parse the current amount reached (aka where it says USD 12,226.1) so I can display it along with the goal amount and track things.

Regex: (?siU)<div class="fs-18 color-black2 mt-2" data-v-61fc2e88="">(.*)</div> ... I've tried a lot of other things too, but that's something similar to what I've used before elsewhere and it works, so I'm not sure what the issue is now.

Skin template:

Code: Select all

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

[GoalStyle]
StringAlign=Left
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=255,255,255,200
FontFace=khagos
FontSize=20
AntiAlias=1
ClipString=1

[CurrentStyle]
StringAlign=Left
StringEffect=Shadow
FontEffectColor=0,0,0,20
FontColor=184,40,62,200
FontFace=khagos
FontSize=25
AntiAlias=1
ClipString=1

[MeasureCurrent]
Measure=WebParser
URL=https://www.makestar.co/projects/singer_jeonyoul_02/story
RegExp=(?siU)<div class="fs-18 color-black2 mt-2" data-v-61fc2e88="">(.*)</div>

[MeasureCurrent1]
Measure=Plugin
Plugin=WebParser
URL=[MeasureCurrent]
StringIndex=1

[GoalText]
Meter=String
MeterStyle=GoalStyle
X=25
Y=30
Text="of 8,831.10"

[CurrentText]
Meter=String
MeasureName=MeasureCurrent1
MeterStyle=CurrentStyle
X=15
Y=0
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can't get regex to work, help appreciated

Post by balala »

Novadestin wrote: September 19th, 2021, 5:13 pm Hello, everyone. I fully admit that I have no real understanding of regex, but I've at least managed to make them work on a basic level for a couple of other sites and I did have this one up and running too, but now it seems they've changed things around and I can't figure it out anymore. So, if anyone can explain how to do this and/or why it's not working, it would be really helpful; thank you!

Site: https://www.makestar.co/projects/singer_jeonyoul_02/story

Plan: To parse the current amount reached (aka where it says USD 12,226.1) so I can display it along with the goal amount and track things.

Regex: (?siU)<div class="fs-18 color-black2 mt-2" data-v-61fc2e88="">(.*)</div> ... I've tried a lot of other things too, but that's something similar to what I've used before elsewhere and it works, so I'm not sure what the issue is now.
Unfortunately in this case you probably won't be able to get the desired information from the site, because that site uses some java scripts to show them up. In such cases WebParser fails, it can't parse this kind of information.
Sorry...
User avatar
Novadestin
Posts: 21
Joined: August 18th, 2016, 11:36 pm

Re: Can't get regex to work, help appreciated

Post by Novadestin »

balala wrote: September 19th, 2021, 6:18 pm Unfortunately in this case you probably won't be able to get the desired information from the site, because that site uses some java scripts to show them up. In such cases WebParser fails, it can't parse this kind of information.
Sorry...
That's alright, at least now I know what the problem is. Thanks for always being helpful balala :)
User avatar
balala
Rainmeter Sage
Posts: 16144
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Can't get regex to work, help appreciated

Post by balala »

Novadestin wrote: September 20th, 2021, 2:07 pm That's alright, at least now I know what the problem is. Thanks for always being helpful balala :)
You're welcome and I'm sorry...