It is currently April 26th, 2024, 9:14 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: 518
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: 518
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: 518
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:
User avatar
DeniroJason
Posts: 1
Joined: December 20th, 2022, 1:08 pm

Re: Simple Bitcoin Tracker

Post by DeniroJason »

I'm having some trouble with my Bitcoin Tracker too.I've tried a few things already, but I'm still having issues. I'm wondering if anyone has any suggestions or has encountered a similar problem. I'm considering checking for updates or changes to the API that I'm using to pull the data for my tracker.The Moon Bitcoin website (https://www.moonbitcoins.com/dashboard) is another resource that I'm considering using to see if I can find any useful information or tools for troubleshooting my tracker.I'm hoping someone might have some ideas or suggestions that can help me. Thanks!
Last edited by DeniroJason on January 3rd, 2023, 9:43 am, edited 1 time in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Simple Bitcoin Tracker

Post by eclectic-tech »

DeniroJason wrote: December 27th, 2022, 6:38 pm I'm having some trouble with my Bitcoin Tracker too.I've tried a few things already, but I'm still having issues. I'm wondering if anyone has any suggestions or has encountered a similar problem.
"Some trouble" doesn't tell us much... Can you add a detailed description of what "troubles" you are having?
MilkyMooCow
Posts: 1
Joined: April 2nd, 2024, 11:10 am

Re: Simple Bitcoin Tracker

Post by MilkyMooCow »

revised the bitcoin tracking code with chat gpt 4 because it was not working, (not a coder) no api key needed or anything, no idea what I'm doing but it should ... maybe not keep breaking anymore with this code. essentially told chatgpt to load the page and have the code visualize the numbers and print them as text rather than whatever it was doing, seems to have gotten around the issue of it only displaying the first value, refreshes on a 60 second timer

Code: Select all

License=GPLv3

[Rainmeter]
Update=1000 ; This updates the skin every second
AccurateText=1

[Metadata]
Name=Bitcoin Tracker
Author=Deofol
Version=1.0
Information=Displays the current Bitcoin price in USD.

[Variables]
fontName=Comic Sans MS
textSize=20
textSizeLarge=24
colorText=255,255,255,205
width=300
height=200
URL=https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd
RegExp="bitcoin\":\{\"usd\":([\d.]+)"

[MeasureJSON]
Measure=Plugin
Plugin=WebParser
URL=#URL#
RegExp=#RegExp#
UpdateRate=60 ; This makes the WebParser measure update every 60 seconds
DynamicVariables=1
FinishAction=[!UpdateMeasure MeasureBitcoinPrice][!UpdateMeter *][!Redraw]

[MeasureBitcoinPrice]
Measure=Plugin
Plugin=WebParser
URL=[MeasureJSON]
StringIndex=1

[MeterBackground]
Meter=Image
W=#width#
H=#height#
SolidColor=0,0,0,150

[MeterTitle]
Meter=STRING
X=(#width#/2)
Y=20
W=#width#
H=30
FontSize=#textSizeLarge#
FontColor=#colorText#
FontFace=#fontName#
FontWeight=Bold
StringAlign=CenterCenter
AntiAlias=1
Text="BITCOIN/USD"
DynamicVariables=1

[MeterPrice]
Meter=STRING
MeasureName=MeasureBitcoinPrice
X=(#width#/2)
Y=60
W=#width#
H=#height#
FontSize=#textSize#
FontColor=#colorText#
FontFace=#fontName#
FontWeight=Bold
StringAlign=CenterCenter
AntiAlias=1
Text="$%1"
DynamicVariables=1