It is currently April 26th, 2024, 8:45 am
Get help with creating, editing & fixing problems with skins
PtitChat107
Posts: 126 Joined: December 31st, 2015, 6:40 pm
Post
by PtitChat107 » June 26th, 2017, 10:48 am
Hi,
I am looking for a solution to make this work but it always returns me an error: RegExp matching error (-1)
Do you have any idea of the problem ?
I was thinking of taking the result directly from the main site (
https://cryptowat.ch/kraken/btceur ) but since it seems to work with JavaScript I'm not sure it will work.
Code: Select all
[measureBitcoin]
Measure=Plugin
Plugin=WebParser
Url=https://api.cryptowat.ch/markets/kraken/btceur/price
UpdateRate=60
StringIndex=1
RegExp="(?siU).*<span class="objectBox objectBox-number">(.*)</span>.*"
Substitute="":"..."
DecodeCharacterReference=1
[meterLabelBitcoin]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Price :
[meterValueBitcoin]
Meter=String
MeterStyle=styleRightText
MeasureName=measureBitcoin
StringIndex=1
X=200
Y=80
W=190
H=14
LeftMouseUpAction=!Execute ["https://cryptowat.ch/kraken/btceur"]
Text=%1
PtitChat107
Posts: 126 Joined: December 31st, 2015, 6:40 pm
Post
by PtitChat107 » June 26th, 2017, 2:50 pm
It's works perfectly, thank you.
Too bad that I can not add the currency (€) behind the measure extracted without it disappears by itself but thank you, I will content myself !
PtitChat107
Posts: 126 Joined: December 31st, 2015, 6:40 pm
Post
by PtitChat107 » June 26th, 2017, 3:08 pm
dvo wrote: just put it behind
I try it but it does not seem to work, amazing I know
When you update the skin, 3 special characters are displayed for a few seconds and then nothing.
jsmorley
Developer
Posts: 22630 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » June 26th, 2017, 3:11 pm
PtitChat107 wrote: I try it but it does not seem to work, amazing I know
When you update the skin, 3 special characters are displayed for a few seconds and then nothing.
You need to encode your skin as Unicode UTF-16 Little Endian in your text editor. Do NOT use ANSI or UTF-8 with Unicode characters, as Rainmeter hates that
https://docs.rainmeter.net/tips/unicode-in-rainmeter/
1.png
2.png
You do not have the required permissions to view the files attached to this post.
PtitChat107
Posts: 126 Joined: December 31st, 2015, 6:40 pm
Post
by PtitChat107 » June 26th, 2017, 3:18 pm
jsmorley wrote: You need to encode your skin as Unicode UTF-16 Little Endian
It works but it disappears as soon as I update the skin, the symbol remains a few seconds and disappears.
dvo wrote: did you put a space between the € and the %1
Yes
balala
Rainmeter Sage
Posts: 16172 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » June 26th, 2017, 3:19 pm
PtitChat107 wrote: I try it but it does not seem to work, amazing I know
When you update the skin, 3 special characters are displayed for a few seconds and then nothing.
Another possibility would be to replace the Sub variable, in the [Variables] section, with the following one:
Sub="\s+":"","\n":"","^(.*)$":"\1€" . If you do so, you also have to add the
RegExpSubstitute=1 option to each measure which uses the above substitution (so, in this case [measureBitcoin], [MeasurePrice], [MeasureCost] and [MeasureRemaining]).
jsmorley
Developer
Posts: 22630 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » June 26th, 2017, 3:36 pm
I don't have your MeterStyle settings, but this works fine for me:
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[measureBitcoin]
Measure=Plugin
Plugin=WebParser
Url=https://api.cryptowat.ch/markets/kraken/btceur/price
UpdateRate=60
StringIndex=1
RegExp=(?siU)price":(.*)\n.*cost":(.*),\n.*remaining":(.*)\n.*
[MeasurePrice]
Measure=Plugin
Plugin=WebParser
URL=[measureBitcoin]
StringIndex=1
[MeasureCost]
Measure=Plugin
Plugin=WebParser
URL=[measureBitcoin]
StringIndex=2
[MeasureRemaining]
Measure=Plugin
Plugin=WebParser
URL=[measureBitcoin]
StringIndex=3
[meterLabelBitcoin]
Meter=String
MeterStyle=styleLeftText
X=10
Y=80
W=190
H=14
Text=Price :
[meterValueBitcoin]
Meter=String
MeasureName=measureBitcoin
X=200
Y=80
StringAlign=Right
LeftMouseUpAction=["https://cryptowat.ch/kraken/btceur"]
Text=%1 €
[meterLabelCost]
Meter=String
MeterStyle=styleLeftText
X=10
Y=100
Text=Cost :
[meterValueCost]
Meter=String
MeasureName=MeasureCost
X=200
Y=100
StringAlign=Right
LeftMouseUpAction=["https://cryptowat.ch/kraken/btceur"]
Text=%1 €
[meterLabelRemaining]
Meter=String
MeterStyle=styleLeftText
X=10
Y=120
Text=Remaining :
[meterValueRemaining]
Meter=String
MeterStyle=styleRightText
MeasureName=MeasureRemaining
StringIndex=3
X=200
Y=120
StringAlign=Right
LeftMouseUpAction=["https://cryptowat.ch/kraken/btceur"]
Text=%1 €
1.png
All that Substitute stuff is just not needed...
Never use !Execute on a bang, it's deprecated and not needed.
Never use StringIndex on a meter, that is only for child WebParser measures.
You do not have the required permissions to view the files attached to this post.
PtitChat107
Posts: 126 Joined: December 31st, 2015, 6:40 pm
Post
by PtitChat107 » June 26th, 2017, 3:40 pm
jsmorley wrote: This works fine for me:
I checked against your model and everything works perfectly, surely an error on my part but thank you for your correction !
jsmorley
Developer
Posts: 22630 Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA
Post
by jsmorley » June 26th, 2017, 3:56 pm
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1
[measureBitcoin]
Measure=Plugin
Plugin=WebParser
Url=https://api.cryptowat.ch/markets/kraken/btceur/price
UpdateRate=60
StringIndex=1
RegExp=(?siU)price":(.*)\n.*cost":(.*),.*remaining":(.*)\n.*
[MeasurePrice]
Measure=Plugin
Plugin=WebParser
URL=[measureBitcoin]
StringIndex=1
[MeasureCost]
Measure=Plugin
Plugin=WebParser
URL=[measureBitcoin]
StringIndex=2
[MeasureRemaining]
Measure=Plugin
Plugin=WebParser
URL=[measureBitcoin]
StringIndex=3
[MeterBackground]
Meter=Shape
Shape=Rectangle 2,2,275,100,12 | StrokeWidth 1.5 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255
[StyleText]
FontSize=12
FontColor=255,255,255,255
FontWeight=400
Padding=5,5,5,5
SolidColor=47,47,47,255
AntiAlias=1
StringAlign=Left
[StyleRight]
StringAlign=Right
X=260
FontWeight=700
[meterLabelBitcoin]
Meter=String
MeterStyle=StyleText
X=10
Y=10
Text=Price :
[meterValueBitcoin]
Meter=String
MeasureName=measureBitcoin
MeterStyle=StyleText | StyleRight
Y=0r
LeftMouseUpAction=["https://cryptowat.ch/kraken/btceur"]
Text=%1 €
[meterLabelCost]
Meter=String
MeterStyle=StyleText
X=10
Y=0R
Text=Cost :
[meterValueCost]
Meter=String
MeasureName=MeasureCost
MeterStyle=StyleText | StyleRight
Y=0r
LeftMouseUpAction=!Execute ["https://cryptowat.ch/kraken/btceur"]
Text=%1 €
[meterLabelRemaining]
Meter=String
MeterStyle=StyleText
X=10
Y=0R
Text=Remaining :
[meterValueRemaining]
Meter=String
MeterStyle=StyleText | StyleRight
MeasureName=MeasureRemaining
Y=0r
LeftMouseUpAction=["https://cryptowat.ch/kraken/btceur"]
Text=%1 €
1.png
You do not have the required permissions to view the files attached to this post.