Problem with home-made Finance::Quote script

Fredrik Persson fredrik.p.persson at gmail.com
Sat Nov 8 10:58:13 EST 2008


That's it! That's the problem!

I had forgotten that I needed to return ALL the symbols requested, not
just one. (I guess I was under the impression that gnucash called the
function repeatedly for each individual quote.)

Anyway, here's the script that works and I'll also try to get this
into Finance::Quote official release. I think it's going to be pretty
useable for anyone using gnucash in Sweden. Swedes loves mutual funds
and this has long been a hurdle for me when advocating gnucash here in
Sweden.

Thank you for your help.

/Fredrik

On Sat, Nov 8, 2008 at 3:55 PM, David Reiser <dbreiser at earthlink.net> wrote:
>
> On Nov 8, 2008, at 7:17 AM, Fredrik Persson wrote:
>
>> David, (and others)
>>
>> I've rewritten my Finance::Quote plugin and now it works for *some*
>> quotes, but not for others. (Script attached.)
>>
>> The symbol "FXXIN06789" works fine. The symbols "NTJUL00779" and
>> "FXIRL00109" gets the same error as before. But I see no difference
>> between those results in gnc-fq-helper, or gnc-fq-dump.
>>
>> Any idea what could be causing this? I see no difference in the time
>> stamps either.
>>
>> /Fredrik
>
> Something is wrong with your setting up or returning an array of multiple
> quotes. Each of those symbols works if you only ask for one quote, but any
> attempt to retrieve multiple quotes fails:
>
> echo '(ftest_funds "NTJUL00779" "FXXIN06789")' | gnc-fq-helper
> (("NTJUL00779" (symbol . "NTJUL00779") (gnc:time-no-zone . "2008-11-04
> 12:00:00") (price . 8391.00) (currency . "EUR"))
>  #f)
>
> echo '(yahoo "IBM" "AAPL")' | gnc-fq-helper
> (("IBM" (symbol . "IBM") (gnc:time-no-zone . "2008-11-07 16:02:00") (last .
> 86.27) (currency . "USD"))
>  ("AAPL" (symbol . "AAPL") (gnc:time-no-zone . "2008-11-07 16:00:00") (last
> . 98.24) (currency . "USD")))
>
> Dave
> --
> David Reiser
> dbreiser at earthlink.net
>
>
>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Ftest.pm
Type: application/x-perl
Size: 2868 bytes
Desc: not available
Url : http://lists.gnucash.org/pipermail/gnucash-devel/attachments/20081108/ff05c65c/attachment.bin 


More information about the gnucash-devel mailing list