[GNC] Problems getting prices from Yahoo as JSON

Adrian Holbrook megagrumpy at hotmail.com
Tue Mar 4 03:01:50 EST 2025


Thanks Bruce and Kalpesh for your help. Sorry to hear of Bruce's health issues and I wish you a speedy recovery.

I think that the issue with the Perl module to download Finance::Quote is that it downloads the latest released version while I was trying to download the development issue. In the end I just copied the relevant YahooJson.pm module and replaced the previous module. Unfortunately my programming experience was limited to Fortran, Basic and Logo (!) and I am a bit rusty!

On the issue of the GBp to GBP conversion Things are now working but there is still a minor issue. When I checked this morning NXR was returning the correct price (I do not understand what has changed) but with NWG I realised that I was retrieving the price from Alphavantage not Yahoo and that was showing 480.5. When I changed the source to Yahoo as JSON it worked correctly and shows 4.803.

Although my issues are now resolved I am still a bit puzzled with the results I got!

Thanks for your help and I am enjoying finding out a bit more about the inner workings of Perl but I fear it is too late for me to become even semi-proficient!

Adrian
________________________________
From: Kalpesh Patel <kalpesh.patel at usa.net>
Sent: 03 March 2025 22:57
To: 'Bruce Schuck' <bschuck at asgard-systems.com>; 'GnuCash User' <gnucash-user at gnucash.org>
Cc: 'Adrian Holbrook' <megagrumpy at hotmail.com>
Subject: RE: [GNC] Problems getting prices from Yahoo as JSON

Hi Bruce:

Hopefully you are on your way to mending from the health issue.

Anyways, your suggestions are duly noted and will keep them in mind.

-----Original Message-----
From: Bruce Schuck <bschuck at asgard-systems.com>
Sent: Monday, March 03, 2025 4:40 PM
To: GnuCash User <gnucash-user at gnucash.org>
Cc: Kalpesh Patel <kalpesh.patel at usa.net>; Adrian Holbrook <megagrumpy at hotmail.com>
Subject: Re: [GNC] Problems getting prices from Yahoo as JSON

Sorry for late response, I've been battling some health issues the last
month+.

On Mar 1, 2025 at 09:06:36 EST, Kalpesh Patel wrote:

 > If you have Unix/Linux then you can run following to get the official  > interim release (literally cut and paste each line when your prompt  > comes back after executing each one) as mentioned by another user  > on this distro:


     cd ~
     wget

https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cpan.org%2Fauthors%2Fid%2FB%2FBP%2FBPSCHUCK%2FFinance-Quote-1.64_03.tar.gz&data=05%7C02%7C%7Ca140570d4e1748c1cf3608dd5aa6d4d6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638766394751254965%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=%2FR7upIWQ8%2Bg3WCiWkngaAKgVj%2FXor2NPKl6K43kNlp4%3D&reserved=0<https://www.cpan.org/authors/id/B/BP/BPSCHUCK/Finance-Quote-1.64_03.tar.gz>
     tar -xvf ./Finance-Quote-1.64_03.tar.gz
     cd Finance-Quote-1.64_03/
     perl Makefile.PL
     make
     sudo make install

Kalpesh,

While this will work for this case (no extra dependencies added), please refrain from suggesting this method of installing Finance::Quote.
Especially to those with limited experience with Perl.

There is no reason that the cpan or cpanm utilities can not be used on Windows with Strawberry Perl, Mac OSX, and especially Linux/Unix/BSD.
For those who for some reason are having difficulties with cpan/cpanm, it would be much more beneficial in the long run to troubleshoot why the standard Perl module install tool is not working.

WRT the GBP/GBp issue, I would appreciate that the issue is duplicated and confirmed BEFORE suggesting a user make manual edits! In the case of NWG.L, Finance::Quote this morning returned Last:4.803 GBP (pounds). A lookup at https://gbr01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.londonstockexchange.com%2Fstock%2FNWG%2Fnatwest-group-plc%2Fcompany-page&data=05%7C02%7C%7Ca140570d4e1748c1cf3608dd5aa6d4d6%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638766394751271330%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=loJYGG0pad%2FMDVUB6lRNwCnqxOVu2fMhB1XfrZFPGWE%3D&reserved=0<https://www.londonstockexchange.com/stock/NWG/natwest-group-plc/company-page>
returned 480.30 GBX (pence). And finance.yahoo.com returned 480.30 GBp (pence). Perhaps asking Adrian what values he was seeing, and why he determined they were incorrect?

Thank you.

Bruce S.



More information about the gnucash-user mailing list