It is currently September 24th, 2022, 8:08 pm

Simple Bitcoin Tracker

RSS, ATOM and other feeds, GMail, Stocks, any information retrieved from the internet
aakrusen
Posts: 3
Joined: August 15th, 2022, 5:12 pm

Re: Simple Bitcoin Tracker

Post by aakrusen »

Hi guys, my BTC ticker stopped working the other day and I cannot see why. The code I'm using is very similar to what's posted here, but I've modified to for visual changes. It seems like the ticker is not working, so I copied the same code listed here and override the code I have, just to make sure I did mess anything up, and the code here doesn't work either.
Where do I start to try and track down why my code and the code listed in this thread are not working?
User avatar
tass_co
Posts: 354
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Simple Bitcoin Tracker

Post by tass_co »

aakrusen wrote: August 15th, 2022, 5:17 pm Hi guys, my BTC ticker stopped working the other day and I cannot see why. The code I'm using is very similar to what's posted here, but I've modified to for visual changes. It seems like the ticker is not working, so I copied the same code listed here and override the code I have, just to make sure I did mess anything up, and the code here doesn't work either.
Where do I start to try and track down why my code and the code listed in this thread are not working?
Can you share your current code. Let's see what causes the problem :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
aakrusen
Posts: 3
Joined: August 15th, 2022, 5:12 pm

Re: Simple Bitcoin Tracker

Post by aakrusen »

Can do!

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
MiddleMouseUpAction=[!RefreshApp]

[Metadata]
Name=Simple Bitcoin Tracker
Author=Deofol
Version=1.0
License=GPLv3
Information=Shows ongoing rate for the USD/BTC pair, max and min 24 hour values.

[Variables]
fontName=Trebuchet MS
textSize=8
colorBar=235,170,0,255
colorText=255,255,255,205
Seconds=10
; Set how many seconds should each update take

; ----------------------------------
; MEASURES return some kind of value
; ----------------------------------

[MeasureParent]
Measure=WebParser
UpdateRate=#Seconds#
URL=https://www.bitstamp.net/api/ticker/
RegExp=(?siU)"last":\s*"(.*)".*"bid":\s*"(.*)".*high":\s*"(.*)".*low":\s*"(.*)"

[MeasurePrice]
Measure=WebParser
URL=[MeasureParent]
StringIndex=2

[MeasureLast]
Measure=WebParser
URL=[MeasureParent]
StringIndex=1

[MeasureLow]
Measure=WebParser
URL=[MeasureParent]
StringIndex=4

[MeasureHigh]
Measure=WebParser
URL=[MeasureParent]
StringIndex=3

; ----------------------------------
; STYLES are used to "centralize" options
; ----------------------------------

[styleTitle]
StringAlign=CENTER
StringCase=UPPER
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,50
FontColor=#colorText#
FontFace=#fontName#
FontSize=10
AntiAlias=1
ClipString=1

[styleLeftText]
StringAlign=LEFT
; Meters using styleLeftText will be left-aligned.
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleRightText]
StringAlign=RIGHT
StringCase=NONE
StringStyle=BOLD
StringEffect=SHADOW
FontEffectColor=0,0,0,20
FontColor=#colorText#
FontFace=#fontName#
FontSize=#textSize#
AntiAlias=1
ClipString=1

[styleBar]
BarColor=#colorBar#
BarOrientation=HORIZONTAL
SolidColor=255,255,255,15

; ----------------------------------
; METERS display images, text, bars, etc.
; ----------------------------------

[GraphBG]
Meter=Shape
Shape=Rectangle 0,0,195,65,5 | Fill Color 0,0,0,100 | StrokeWidth 1 | Stroke Color 255,255,255,80
; The style, shape, color, and radius corners of the box surrounding the data.

[meterTitle]
Meter=STRING
MeterStyle=styleTitle
; Using MeterStyle=styleTitle will basically "copy" the
; contents of the [styleTitle] section here during runtime.
X=95
Y=5
W=190
H=18
Text="Bitcoin"

[MeterPrice]
Meter=String
MeasureName=MeasurePrice
X=190
Y=20
FontSize=10
FontColor=255,102,0,255
; Blaze Orange color is 255,102,0,255.
; White color is 255,255,255,255.
InlineSetting=Face | Roboto-Bold
StringAlign=Right
StringStyle=Bold
AntiAlias=1
; This is the current price of BTC in US currency.

[CurrencyText]
Meter=String
Text=USD - BTC
StringAlign=Center
StringStyle=Bold
X=162
Y=40
FontSize=8
FontColor=255,255,255,255
InlineSetting=Face | Roboto-Bold
AntiAlias=1
; The text below the current price.

[CurrencySymbol]
Meter=String
Text=$
StringAlign=Center
StringStyle=Bold
X=110
Y=20
FontSize=10
FontColor=255,102,0,255
InlineSetting=Face | Roboto-Bold
AntiAlias=1
; The money symbol in front of the current price.

[24HrHighPrice]
Meter=String
Text=24 Hr High
StringAlign=Left
StringStyle=Bold
X=3
Y=20
FontSize=6
FontColor=255,255,255,255
InlineSetting=Face | Roboto-Bold
AntiAlias=1
; The highest price over last 24 hours.

[HighText]
Meter=String
MeasureName=MeasureHigh
StringAlign=Left
X=3
Y=28
FontSize=8
FontColor=0,255,0,255
InlineSetting=Face | Roboto-Bold
AntiAlias=1
; The highest price it has been for a the last 24hr (still figureing that out).

[24HrLowPrice]
Meter=String
Text=24 Hr Low
StringAlign=Left
StringStyle=Bold
X=3
Y=40
FontSize=6
FontColor=255,255,255,255
InlineSetting=Face | Roboto-Bold
AntiAlias=1
; The lowest price over last 24 hours.

[LowText]
Meter=String
MeasureName=MeasureLow
StringAlign=Left
X=3
Y=48
FontSize=8
FontColor=255,0,0,255
InlineSetting=Face | Roboto-Bold
AntiAlias=1
; The lowerest price it has been for the last 24hr (still figureing that out).
Last edited by Brian on August 16th, 2022, 5:08 am, edited 1 time in total.
Reason: Please use [code] tags. It's the </> button. Thanks.
User avatar
tass_co
Posts: 354
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Simple Bitcoin Tracker

Post by tass_co »

aakrusen wrote: August 15th, 2022, 7:10 pm Can do!
The problem was caused by changing the sorting places in the incoming data.

Can you change the RegExp code below and try again?

Code: Select all

[MeasureParent]
.
.
.
RegExp=(?siU).*"high".*"(.*)".*"last".*"(.*)".*"bid".*"(.*)".*"low".*"(.*)"
And also if you are sharing a code, we would be glad if you could share it with the help of the Code Display button on the panel :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great:
aakrusen
Posts: 3
Joined: August 15th, 2022, 5:12 pm

Re: Simple Bitcoin Tracker

Post by aakrusen »

Thanks for finding the error. I haven't touch the code since I set it up a long time ago, I'm wondering if Bitstamp changed the RegExp order and that's why it wasn't working?

Also, thanks for the heads up on the Code-Display thing. I'm new enough to this stuff that I didn't know how to post it in that manner, but I should be able to do it correctly next time! :)
User avatar
tass_co
Posts: 354
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Simple Bitcoin Tracker

Post by tass_co »

aakrusen wrote: August 15th, 2022, 7:53 pm Thanks for finding the error. I haven't touch the code since I set it up a long time ago, I'm wondering if Bitstamp changed the RegExp order and that's why it wasn't working?
15.08.2022 - 22.55.52-Mozilla Firefox.png
Yes, the data from Bitstamp has changed.
Sorting on old incoming data: "last,bid,high,low"
RegExp was giving an error because the sorting in the new data was:"high, last, bid, low".

aakrusen wrote: August 15th, 2022, 7:53 pm Also, thanks for the heads up on the Code-Display thing. I'm new enough to this stuff that I didn't know how to post it in that manner, but I should be able to do it correctly next time! :)
:great:
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great: