Coder Social home page Coder Social logo

Comments (9)

jralls avatar jralls commented on June 9, 2024 1

We've rewritten the F::Q interaction for GnuCash 5, which we'll release next spring, to collect and report a lot more error state from F::Q, including errormsg.

from finance-quote.

bpschuck avatar bpschuck commented on June 9, 2024 1

@jayenashar Not having used GnuCash 5.x myself yet, I believe this is now in place. So unless there is an objection, I will close this issue in the next few days.
Thank you.

from finance-quote.

bpschuck avatar bpschuck commented on June 9, 2024

Actually I misspoke earlier today, but I did find a bug in the code. The quote hash for each security can include an "errormsg" key value. Many of the methods don't populate it and the logic in Alphavantage.pm skips populating it when an "Information" key value pair is returned. The conversation I remember was a contributor wanting to be able to control printing the message to stdout or stderr based on a flag passed by environment variable or other means. A quick PoC gives me this.

use Finance::Quote;
my $q = Finance::Quote->new('alphavantage' => {API_KEY => 'demo'});
%quotes = $q->fetch("alphavantage", "F");
print "The price of Ford is " . $quotes{"F", "last"} . "\n";
if ( defined($quotes{"F","errormsg"}) ) {
  print "Errormsg: " . $quotes{"F","errormsg"} . "\n";
}

Running it returns:

The price of Ford is 
Errormsg: The **demo** API key is for demo purposes only. Please claim your free API key at (https://www.alphavantage.co/support/#api-key) to explore our full API offerings. It takes fewer than 20 seconds.

Change 'demo' in the code to a valid API Key and the price is valid but no error message is shown. Is this inline with what you are looking for?

from finance-quote.

jayenashar avatar jayenashar commented on June 9, 2024

sorry, i don't know. i'm just trying to improve the user experience of the average gnucash user. if you do print based on errormsg then you need @jrails or someone from gnucash to pick it up and present it to the user.

from finance-quote.

bpschuck avatar bpschuck commented on June 9, 2024

I'd have to ask, but I think they are aware of "errormsg" being a possible part of the quote hash passed back to GnuCash.

from finance-quote.

bpschuck avatar bpschuck commented on June 9, 2024

You may have seen my post to the gnucash-devel mailing list. Waiting for a response.

from finance-quote.

jayenashar avatar jayenashar commented on June 9, 2024

I didn't see it so thanks for letting me know.

from finance-quote.

bpschuck avatar bpschuck commented on June 9, 2024

No one responded to my list email. So I created a bugs.gnucash.org account and posted my email to https://bugs.gnucash.org/show_bug.cgi?id=798466.

from finance-quote.

jayenashar avatar jayenashar commented on June 9, 2024

thanks for your persistence

from finance-quote.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.