It is currently April 20th, 2024, 2:01 pm

Cryptometer : can't get it to work anymore

Get help with creating, editing & fixing problems with skins
Narb
Posts: 4
Joined: October 26th, 2022, 7:55 am

Cryptometer : can't get it to work anymore

Post by Narb »

Hi,

I'm looking for help to get the Cryptometer skin to work again.
The main issue is not about the regexp or getting data, the data is correctly downloaded from website, and parsed with the regexp.
I just can't figure out why the values won't show up on the skin.

Here is the code (found on github and adapted a bit) :

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=Cryptometer
Author=Petitsurfeur (https://github.com/petitsurfeur)
Information=Skin that tracks a given set of cryptocurrencies.
License=Creative Commons BY-NC-SA 4.0
Version=0.8 2020-04-01

[Variables]
@Include1=#@#variables.ini
@Include2=#@#styles.ini
@Include3=#@#background.ini
API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX

#Adjust the total height of the widget (10 lines x 30px per line)
BackgroundHeight=300
LeftPadding=10
TopPadding=10
RowHeight=24
AutoBorder=1


# Adjusts the distance columns from the left of the widget
ColumnLabelLeftPadding=(#LeftPadding#+25)
ColumnValueLeftPadding=(#LeftPadding#+70)
Column1hrLeftPadding=(#LeftPadding#+150)
Column24hrLeftPadding=(#LeftPadding#+220)
Column7dLeftPadding=(#LeftPadding#+290)

# Footer - Last Updated
BackgroundFooterY=(#BackgroundHeight#-20)
BackgroundFooterX=(#Column7dLeftPadding#-90)

[StyleGreenText]
FontColor=0,153,51,255

[StyleRedText]
FontColor=210,72,54,255

[StyleUpdatedAt]
;StringAlign=RightCenter
FontSize=9
;Padding=0,0,0,5
X=(#BackgroundFooterX#)
Y=(#BackgroundFooterY#)
;W=190
;H=20


# Column Headers__________________________________________________________________


[MeterColumnValue]
Meter=String
MeterStyle=StyleSmallText | StyleWhiteText | StyleLeftAlign
X=#ColumnValueLeftPadding#
Y=#TopPadding#
Text=EUR

[MeterColumn1hr]
Meter=String
MeterStyle=StyleSmallText | StyleWhiteText | StyleLeftAlign
X=#Column1hrLeftPadding#
Y=#TopPadding#
Text=1H

[MeterColumn24hr]
Meter=String
MeterStyle=StyleSmallText | StyleWhiteText | StyleLeftAlign
X=#Column24hrLeftPadding#
Y=#TopPadding#
Text=24H

[MeterColumn7d]
Meter=String
MeterStyle=StyleSmallText | StyleWhiteText | StyleLeftAlign
X=#Column7dLeftPadding#
Y=#TopPadding#
Text=7J

[MeasureLastUpdated]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=7

[MeasureLastUpdatedFormatted]
Measure=String
String=0

[MeterLastUpdated]
Meter=String
MeasureName=MeasureLastUpdated
MeterStyle=StyleSmallText | StyleUpdatedAt
X=(#BackgroundFooterX#)
Y=(#BackgroundFooterY#)


##### Bitcoin (BTC)__________________________________________________________________
[MeasureBTCData]
UserAgent=Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0
URL=https://pro-api.coinmarketcap.com/v1/cryptocurrency/quotes/latest?symbol=BTC&convert=EUR
Measure=WebParser
;URL=file://XXX\WebParserDump.txt
Header=X-CMC_PRO_API_KEY:#API_KEY#

RegExp=(?siU)"name":"(.*)".*"symbol":"(.*)",.*"price".*(\d*\.\d{0,2}?).*"percent_change_1h".*([-+]?\d*\.\d{0,2}?).*"percent_change_24h".*([-+]?\d*\.\d{0,2}?).*"percent_change_7d".*([-+]?\d*\.\d{0,2}?).*"last_updated":"(.*)\..*Z
UpdateRate=900 # every 15 minutes
Debug=2

# Extract each column's value by the index

[MeasureBTCName]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=1

[MeasureBTCSymbol]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=2

[MeasureBTCEURValue]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=3

[MeasureBTCEURPrice]
Measure=Calc
Formula=[MeasureBTCEURValue]
DynamicVariables=1

[MeasureBTC1hr]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=4
IfCondition=MeasureBTC1hr < 0
IfTrueAction=[!SetOption MeterBTCColumn1hr MeterStyle "StyleSmallText | StyleLeftAlign | StyleRedText"]
IfFalseAction=[!SetOption MeterBTCColumn1hr MeterStyle "StyleSmallText | StyleLeftAlign | StyleGreenText"]

[MeasureBTC1hrCalc]
Measure=Calc
Formula=[MeasureBTC1hr]
DynamicVariables=1

[MeasureBTC24hr]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=5
IfCondition=MeasureBTC24hr < 0
IfTrueAction=[!SetOption MeterBTCColumn24hr MeterStyle "StyleSmallText | StyleLeftAlign | StyleRedText"]
IfFalseAction=[!SetOption MeterBTCColumn24hr MeterStyle "StyleSmallText | StyleLeftAlign | StyleGreenText"]

[MeasureBTC24hrCalc]
Measure=Calc
Formula=[MeasureBTC24hr]
DynamicVariables=1

[MeasureBTC7d]
Measure=WebParser
URL=[MeasureBTCData]
StringIndex=6
IfCondition=MeasureBTC7d < 0
IfTrueAction=[!SetOption MeterBTCColumn7d MeterStyle "StyleSmallText | StyleLeftAlign | StyleRedText"]
IfFalseAction=[!SetOption MeterBTCColumn7d MeterStyle "StyleSmallText | StyleLeftAlign | StyleGreenText"]

[MeasureBTC7dCalc]
Measure=Calc
Formula=[MeasureBTC7d]
DynamicVariables=1


# Render the columns with their appropriate values

[MeterBTCIcon]
Meter=Image
MeasureName=MeasureBTCSymbol
MeasureName2=MeasureBTCName
ImageName=@Resources/icons/%1.png
X=#LeftPadding#
Y=(#TopPadding#+(#RowHeight#*1))
W=23
H=23
PreserveAspectRatio=1
LeftMouseUpAction=["https://coinmarketcap.com/currencies/[&MeasureBTCName]"]

[MeterBTCColumnLabel]
Meter=String
MeterStyle=StyleSmallText | StyleLeftAlign
X=#ColumnLabelLeftPadding#
Y=(#TopPadding#+(#RowHeight#*1))
MeasureName=MeasureBTCSymbol
Text=%1

[MeterBTCColumnValue]
Meter=String
MeasureName=MeasureBTCEURPrice
MeterStyle=StyleSmallText | StyleLeftAlign
X=#ColumnValueLeftPadding#
Y=(#TopPadding#+(#RowHeight#*1))
NumOfDecimals=2
Text=%1 €

[MeterBTCColumn1hr]
Meter=String
MeasureName=MeasureBTC1hrCalc
MeterStyle=StyleSmallText | StyleLeftAlign
X=#Column1hrLeftPadding#
Y=(#TopPadding#+(#RowHeight#*1))
NumOfDecimals=2
Text=%1%

[MeterBTCColumn24hr]
Meter=String
MeasureName=MeasureBTC24hrCalc
MeterStyle=StyleSmallText | StyleLeftAlign
X=#Column24hrLeftPadding#
Y=(#TopPadding#+(#RowHeight#*1))
NumOfDecimals=2
Text=%1%

[MeterBTCColumn7d]
Meter=String
MeasureName=MeasureBTC7dCalc
MeterStyle=StyleSmallText | StyleLeftAlign
X=#Column7dLeftPadding#
Y=(#TopPadding#+(#RowHeight#*1))
NumOfDecimals=2
Text=%1%
This is the variables status :

Image

This is the result I have :

Image

And this is what I should have :

Image

Any help much appreciated.
Thanks
User avatar
tass_co
Posts: 515
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Cryptometer : can't get it to work anymore

Post by tass_co »

Narb wrote: October 26th, 2022, 8:06 am Hi,
I just can't figure out why the values won't show up on the skin.

Any help much appreciated.
Thanks
Add DynamicVariables=1 to your string meters.
I don't know where i going from here, but i promise it won't be boring... :great:
Narb
Posts: 4
Joined: October 26th, 2022, 7:55 am

Re: Cryptometer : can't get it to work anymore

Post by Narb »

It did not help.

In fact when you look at the variables status picture I posted above :

The MeasureBTCEURPrice shows 0. Itis calculated from MEasureBTCEURValue which contains the right value.
The issue is the same for every variable finishing with calc, it says 0 but should be the same value as their "non-calc" counterparts.

Another issue is the %1 doesn't seem to output anything, because BTC should show up in front of its line (and it doesn't) and same deal for the icon, the path to it contains %1 and the log says this :
ImageName: Unable to open: C:\Users\xxxxx\Documents\Rainmeter\Skins\Win10 Widgets\Cryptometer\@Resources/icons/.png (Win10 Widgets\Cryptometer\Cryptometer-New.ini)

The meter uses : ImageName=@Resources/icons/%1.png
And from the log %1 returns nothing, despite the variable having the right value. Result should be :
C:\Users\xxxxx\Documents\Rainmeter\Skins\Win10 Widgets\Cryptometer\@Resources/icons/BTC.png
User avatar
tass_co
Posts: 515
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Cryptometer : can't get it to work anymore

Post by tass_co »

Narb wrote: October 26th, 2022, 9:21 am It did not help.

In fact when you look at the variables status picture I posted above :

The MeasureBTCEURPrice shows 0. Itis calculated from MEasureBTCEURValue which contains the right value.
The issue is the same for every variable finishing with calc, it says 0 but should be the same value as their "non-calc" counterparts.

Another issue is the %1 doesn't seem to output anything, because BTC should show up in front of its line (and it doesn't) and same deal for the icon, the path to it contains %1 and the log says this :
ImageName: Unable to open: C:\Users\xxxxx\Documents\Rainmeter\Skins\Win10 Widgets\Cryptometer\@Resources/icons/.png (Win10 Widgets\Cryptometer\Cryptometer-New.ini)

The meter uses : ImageName=@Resources/icons/%1.png
And from the log %1 returns nothing, despite the variable having the right value. Result should be :
C:\Users\xxxxx\Documents\Rainmeter\Skins\Win10 Widgets\Cryptometer\@Resources/icons/BTC.png
Ok.We can help better if you pack and ship your work
I don't know where i going from here, but i promise it won't be boring... :great:
Narb
Posts: 4
Joined: October 26th, 2022, 7:55 am

Re: Cryptometer : can't get it to work anymore

Post by Narb »

Below is a zip file containing Win10Widgets folder, to put into the skins folder of rainmeter. The cryptometer skin is the one we are talking about here.

https://we.tl/t-8FJ6ZqRaQf

Inside you have 2 files :
- Cryptometer-New.ini which is the one we are talking about here
- Cryptometer-Medium.ini which was used before and worked perfectly until 2 days ago. It stopped working after updating Win10Widgets.

The issue seems the same on both skins, no clue on what's happening.
I tried to install this on my work laptop, which never had rainmeter, same result.
User avatar
tass_co
Posts: 515
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Cryptometer : can't get it to work anymore

Post by tass_co »

Narb wrote: October 26th, 2022, 10:29 am Below is a zip file containing Win10Widgets folder, to put into the skins folder of rainmeter. The cryptometer skin is the one we are talking about here.

https://we.tl/t-8FJ6ZqRaQf

Inside you have 2 files :
- Cryptometer-New.ini which is the one we are talking about here
- Cryptometer-Medium.ini which was used before and worked perfectly until 2 days ago. It stopped working after updating Win10Widgets.

The issue seems the same on both skins, no clue on what's happening.
I tried to install this on my work laptop, which never had rainmeter, same result.
I saw APIKEY in variables.
Do you have APIKEY?
If you do not have an APIKEY, the skin will not work.

Code: Select all


[Variables]
@Include1=#@#variables.ini
@Include2=#@#styles.ini
@Include3=#@#background.ini
API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXX
I don't know where i going from here, but i promise it won't be boring... :great:
Narb
Posts: 4
Joined: October 26th, 2022, 7:55 am

Re: Cryptometer : can't get it to work anymore

Post by Narb »

I just tried to reinstall the rmskin from win10widgets and after setting up everything again, well... both scripts work now.
Something must have gone wrong somewhere, but the scripts work fine.

Thanks for attempting to help anyway !

Edit : the right api key is in the files sent yes
User avatar
tass_co
Posts: 515
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Re: Cryptometer : can't get it to work anymore

Post by tass_co »

Narb wrote: October 26th, 2022, 10:40 am I just tried to reinstall the rmskin from win10widgets and after setting up everything again, well... both scripts work now.
Something must have gone wrong somewhere, but the scripts work fine.

Thanks for attempting to help anyway !

Edit : the right api key is in the files sent yes
I'm glad you solved your problem :thumbup:
I don't know where i going from here, but i promise it won't be boring... :great: