Erik,

Thanks for the quick reply. The error message is gone with 1.47, although
I'm still unsuccessful in retrieving any quotes from what looks like an
issue on the AlphaVantage site:

#perl /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-dump
alphavantage SCHB
Finance::Quote fields Gnucash uses:
    symbol: SCHB (deduced)       <=== required
      date: ** missing **        <=== recommended
  currency: ** missing **        <=== required
      last:                      <=\
       nav:                      <=== one of these
     price:                      <=/
  timezone:                      <=== optional

** This stock quote cannot be used by GnuCash!

#perl -Ilib ~/.cpan/build/Finance-Quote-1.47-IUv7sO/Examples/stockdump.pl
alphavantage SCHB
$VAR1 = {
          'SCHBsuccess' => 0,
          'SCHBerrormsg' => 'Internal Server Error'
        };

Is this the expected behavior/response from Alphavantage when receiving an
"empty" quote?

Greg
917-664-0083
http://gregetling.com
--
"The credit belongs to the man who is actually in the arena, whose face is
marred by dust and sweat and blood; who strives valiantly; who errs, who
comes short again and again, because there is no effort without error and
shortcoming" -Theodore Roosevelt

On Sun, Nov 12, 2017 at 12:43 PM, Erik Colson <e...@ecocode.net> wrote:

>
> Greg Etling <g...@gregetling.com> writes:
>
> > Commands:
> > export ALPHAVANTAGE_API_KEY=XXX...
> > perl /Applications/Gnucash.app/Contents/Resources/bin/gnc-fq-dump -v
> > alphavantage SCHB.US
> >
> > Note: same exact behavior happens with 'SCHB' and 'US:SCHB' formulations
> > and other ticker symbols.
> >
> > Output:
> > malformed JSON string, neither array, object, number, string or atom, at
> > character offset 0 (before "Can't connect to www...") at
> > /Library/Perl/5.18/Finance/Quote/AlphaVantage.pm line 138.
> >
> > For reference, line 138:
> > my $json_data = JSON::decode_json $body;
>
> The page returned by alphavantage is sometimes empty.  On my system the
> SCHB works correctly from F::Q.
>
> ~/DEVELOPMENT/finance-quote >>> perl -Ilib Examples/stockdump.pl
> alphavantage SCHB
>
> ±[master]
> $VAR1 = {
>           'SCHBopen' => '62.2500',
>           'SCHBcurrency_set_by_fq' => 1,
>           'SCHBisodate' => '2017-11-10',
>           'SCHBdate' => '11/10/2017',
>           'SCHBvolume' => '234359',
>           'SCHBcurrency' => 'USD',
>           'SCHBlow' => '62.1800',
>           'SCHBsuccess' => 1,
>           'SCHBclose' => '62.3200',
>           'SCHBhigh' => '62.3700',
>           'SCHBsymbol' => 'SCHB',
>           'SCHBmethod' => 'alphavantage',
>           'SCHBlast' => '62.3200'
>         };
>
> This is with version 1.47.  Please try with at least 1.46.
>
> best
> --
> erik colson
> _______________________________________________
> gnucash-user mailing list
> gnucash-user@gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
_______________________________________________
gnucash-user mailing list
gnucash-user@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-user
-----
Please remember to CC this list on all your replies.
You can do this by using Reply-To-List or Reply-All.

Reply via email to