It is currently March 28th, 2024, 4:56 pm

[WebParser] how can I remove the zeros in RegExp value ?

Get help with creating, editing & fixing problems with skins
Post Reply
Dasko
Posts: 3
Joined: September 11th, 2017, 8:09 pm

[WebParser] how can I remove the zeros in RegExp value ?

Post by Dasko »

Hallo there,

How can I get rid of the zeros and show only the last three numbers

Code: Select all

[GetXVGPrice]
Update=10000
Measure=Plugin
Plugin=WebParser
#URL=https://bittrex.com/api/v1.1/public/getmarketsummary?market=btc-xvg
#RegExp=(?siU),"Ask": "(....)
URL=https://bittrex.com/api/v1.1/public/getticker?market=btc-xvg
RegExp=(?siU),"Last":(.*)}

[MeterXVGValue]
Update=1000
Meter=String
MeasureName=XVGPrice 
X=82
Y=51
FontFace=#Font0#
FontSize=8
font=#Font0#
FontColor=255,255,255,128
StringAlign=Left
AntiAlias=1
any help would be appreciated.
Attachments
verge.png
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [WebParser] how can I remove the zeros in RegExp value ?

Post by balala »

Are you sure the posted code works? Because I couldn't get it, with none of the posted URL. In fact, pasting any of them to the web browser, .json files are downloaded. In such cases, the WebParser plugin measure doesn't returns strings.
However, if it works well, adding the following options to the [GetXVGPrice] measure could help:

Code: Select all

RegExpSubstitute=1
Substitute="^0\.0+(\d+)$":"\1"
According to the substitution, the existing zeros at the beginning of the returned number are eliminated, remaining just the number existing after them.
But another problem I have is that the mentioned measure ([GetXVGPrice], which should get the number), doesn't has a StringIndex option. This is another thing why I think the measure can't work, at least not for returning the number you're looking for.
And one more: be careful, commenting out an option in .ini files is done using semicolon (;), not #.
Dasko
Posts: 3
Joined: September 11th, 2017, 8:09 pm

Re: [WebParser] how can I remove the zeros in RegExp value ?

Post by Dasko »

balala wrote:Are you sure the posted code works? Because I couldn't get it, with none of the posted URL. In fact, pasting any of them to the web browser, .json files are downloaded. In such cases, the WebParser plugin measure doesn't returns strings.
However, if it works well, adding the following options to the [GetXVGPrice] measure could help:

Code: Select all

RegExpSubstitute=1
Substitute="^0\.0+(\d+)$":"\1"
According to the substitution, the existing zeros at the beginning of the returned number are eliminated, remaining just the number existing after them.
But another problem I have is that the mentioned measure ([GetXVGPrice], which should get the number), doesn't has a StringIndex option. This is another thing why I think the measure can't work, at least not for returning the number you're looking for.
And one more: be careful, commenting out an option in .ini files is done using semicolon (;), not #.
First off, thank you for taking the time to offer your help.
secondly your suggestion wiped the entire numbers. thank you!
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [WebParser] how can I remove the zeros in RegExp value ?

Post by balala »

Dasko wrote:your suggestion wiped the entire numbers.
What you mean by this? What you got on the skin, when added the options?
Dasko
Posts: 3
Joined: September 11th, 2017, 8:09 pm

Re: [WebParser] how can I remove the zeros in RegExp value ?

Post by Dasko »

balala wrote:What you mean by this? What you got on the skin, when added the options?

Code: Select all

[XVGPrice]
Update=1000
Measure=Plugin
Plugin=WebParser 
URL=[GetXVGPRice]
StringIndex=1
RegExpSubstitute=1
Substitute="^0\.0+(\d+)$":"\1"

I meant it worked my friend thank you.
Attachments
Untitled.png
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [WebParser] how can I remove the zeros in RegExp value ?

Post by balala »

Dasko wrote:I meant it worked my friend thank you.
Ok, I'm glad in this case.
Post Reply