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

Help with creating, editing & fixing problems with skins

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

September 11th, 2017, 8:18 pm
Dasko
   [3 posts]

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

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

September 12th, 2017, 1:08 pm
balala
Rainmeter Sage   [4572 posts]

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 #.

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

September 12th, 2017, 10:59 pm
Dasko
   [3 posts]

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

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

September 13th, 2017, 1:29 pm
balala
Rainmeter Sage   [4572 posts]

Dasko wrote:your suggestion wiped the entire numbers.

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

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

September 13th, 2017, 3:41 pm
Dasko
   [3 posts]

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

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

September 13th, 2017, 3:48 pm
balala
Rainmeter Sage   [4572 posts]

Dasko wrote:I meant it worked my friend thank you.

Ok, I'm glad in this case.

Return to “Help: Rainmeter Skins”



Who is online

Users browsing this forum: mak_kawa and 1 guest