Problem obtaining share price

Leslie Katz lesliek at ozemail.com.au
Fri Jun 23 01:43:56 EDT 2006


David Hampton wrote:
>
> Yes, this is a problem with Yahoo.  Instead of returning the currency
> "AUD" for WCTPA.AX, or not returning any currency, yahoo is declaring
> that the currency is "".  F::Q can handle the first two, but doesn't
> handle the latter.
>
> The attached patch should solve the problem for you.
>
> David
>
>   
> ------------------------------------------------------------------------
>
> Index: lib/Finance/Quote/Yahoo/Base.pm
> ===================================================================
> RCS file: /cvsroot/finance-quote/finance-quote/lib/Finance/Quote/Yahoo/Base.pm,v
> retrieving revision 1.23
> diff -u -r1.23 Base.pm
> --- lib/Finance/Quote/Yahoo/Base.pm	8 Apr 2006 00:20:53 -0000	1.23
> +++ lib/Finance/Quote/Yahoo/Base.pm	22 Jun 2006 14:24:40 -0000
> @@ -203,7 +203,8 @@
>  				# Every now and then on a failed
>  				# retrieval, Yahoo will drop in an
>  				# undefined field
> -				$info{$symbol,$FIELDS[$i]} = $q[$i] if defined $q[$i];
> +			        if (defined $q[$i] && length $q[$i])
> +				    $info{$symbol,$FIELDS[$i]} = $q[$i];
>  			}
>  
>  			# Yahoo returns a line filled with N/A's if we
>   
Hi David.

Thank you for replying yet again to one of my problem posts.

Reassured by your reply that the error had been Yahoo's, I decided to 
try dump-finance-quote again today, about twenty-four hours after my 
first attempt. Today, Yahoo returned the currency for the share and so I 
tried the Price Editor as well. This time, it didn't complain about 
WCTPA. It seems as though Yahoo corrected the matter itself. It must've 
been a teething problem, the shares having been listed only yesterday.

In the circumstances, the patch seems unnecessary, which is a good thing 
in one sense, since my knowledge in these matters is so shallow that I 
simply don't know what I should be doing with it anyway! (I know I could 
have avoided admitting that, but it seemed cowardly.)

Thanks again,

Leslie


More information about the gnucash-user mailing list