Gadget Currency Meter

Status
Not open for further replies.

BFG-9000

Respectable
Sep 17, 2016
167
0
2,010
5 years ago Microsoft found unsolvable security issues with Gadgets and discontinued them. It's probably perfectly safe to use the ones included with Windows but a currency gadget that has its own direct internet connection to a 3rd party sounds like bad news.

However even the included ones would occasionally malfunction, particularly the CPU meter. The fix was to remove them all and reboot, then re-enable them.
 

freebeerjkt

Prominent
Dec 23, 2017
12
0
560
There is no solution unless the developer updates. The currencies were based on Yahoo data but Yahoo changed their servers so no data anymore. If anyone comes up with a good alternative please post here.
 

81kab

Prominent
Jan 12, 2018
6
2
510
Hi there, I want to share my workaround for this issue.

First, when looking through the gadget code I noticed that it use 3rd-party service (Yahoo) to retrieve currency values. But unfortunately Yahoo has closed that service ( https://forums.yahoo.net/t5/Yahoo-Finance-help/http-download-finance-yahoo-com-d-quotes-csv-s-GOOG-amp-f/td-p/387096 ).

I decided to use Google Spreadsheets where it is possible to use GoogleFinance() function and export the spreadsheet to CSV file. In my case, I'm going to track USD/RUB and EUR/RUB pairs. I think you could easily replace them with yours.

Step 1.
Create a new google spreadsheet. First column should contain your currency pairs divided by "/" symbol. Second column will have results of GoogleFinance() calculation.

Step 2.
Fill the table. For example, this is my table:
8f553bdc0d8244225f8d6f8033747357.png

Currencies will update automatically.

Step 3.
Go to menu and select "File" -> "Publish to Web". Next shoose CSV format and click "Publish".
You will get a URL, something like https://docs.google.com/spreadsheets/.../pub?gid=0&single=true&output=csv . Save it to a safe place.

Step 4.
Now we will need to change URL in the gadget's code.
Go to folder C:\Users\[your user name]\AppData\Local\Microsoft\Windows Sidebar\Gadgets\Currency_Meter.gadget\

Find a file called "gadget.js" and open it with a text editor, e.g. Notepad.
You will see a lot of minified code, copy all the code and paste it to http://unminify.com/ . Click "Unminify".
Next, replace all minified code with unminified one. Save the gadget.js file.

Step 5.
In the gadget.js file find definition of function getData() (line #1393 for me). Replace all the code inside the curly brackets with this code:
JavaScript:
getDataURL('YOUR URL FROM STEP 3');
Where you should paste URL from the Step 3 inside the brackets.

In my case:
207f0fc04c00b050960129d7e3ee3788.png


Next, save the file.

Step 6.
Now you will need to disable the Currency Meter gadget and then enable it again. If everything goes well, you will see it is working again!

d368299a18aac02459a311a8bee0f13d.png


Feel free to ask any questions, I will try to help.
 
  • Like
Reactions: Chessster

freebeerjkt

Prominent
Dec 23, 2017
12
0
560


Thanks so much for your kind help. I will give this a try.
Best regards.
 

freebeerjkt

Prominent
Dec 23, 2017
12
0
560


 

freebeerjkt

Prominent
Dec 23, 2017
12
0
560
OK, I looked at this but a few problems.
1) There is a cost to use Google Spreadsheets, subscription which I don't really want to do. A one time small fee would not be bad but subscription means forever. Is there any way that Microsoft Office Excel can be used ?.
2) I found the file called "gadget.js" and opened it with Windows 10 Notepad. But I just get a huge amount of text, too hard to work with and no line numbers. Also tried to open with NotePad++ but then I just get a very long single line of text. Line 1.
 

81kab

Prominent
Jan 12, 2018
6
2
510


1) Weird, I didn't pay anything for Google Spreadsheets. Just used my regular Google account and created a table here: https://docs.google.com/spreadsheets/u/0/ . MS Office Excel can't be used for that case.
2) Use unminify tool, as I descriibed on Step 4: http://unminify.com/ . This tool will make the code more readable.

 

freebeerjkt

Prominent
Dec 23, 2017
12
0
560


 

freebeerjkt

Prominent
Dec 23, 2017
12
0
560
OK, many thanks again and sorry that I previously overlooked the part about using the unminify tool. Now I got it working but in my case I live in Indonesia, currency is IDR (Indonesian Rupiah). There are other currencies in the region that I want to see too. Converting from USD to Singapore $ is working perfectly but for some unknown reason anything I try to convert using IDR the currency meter just shows NaN and I have no idea what that means. Using the Google sheet the currency IDR is working fine. I could show you a screen shot but I have no idea how to add a picture here ?.


 

81kab

Prominent
Jan 12, 2018
6
2
510


I just tried to add IDR to my list and it works for me:

1080a168f22bf58b6a7eb2c8c5dcc19b.png


9ff312d5bb058fed6645a61dde057d6b.png


Hope these screenshots would be useful.
 
  • Like
Reactions: Chessster

freebeerjkt

Prominent
Dec 23, 2017
12
0
560


 

81kab

Prominent
Jan 12, 2018
6
2
510


Just upload your screenshot somewhere, copy the URL of the picture. When press Ctrl + P while typing a message and paste the URL. Press "OK".

 

81kab

Prominent
Jan 12, 2018
6
2
510


Ok I got it. You need to change numbers format. Should be dot "." instead of comma "," in the values.
E.g., 1.234 instead of 1,234

Open "File" -> "Table options". Under "Regional settings" choose United States and press "Save".

 
Status
Not open for further replies.