Skip Menu |

This queue is for tickets about the Finance-Quote CPAN distribution.

Report information
The Basics
Id: 77111
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Finance-Quote

People
Owner: eco [...] ecocode.net
Requestors: gabriele.mailing [...] rvmgroup.it
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Price missing on some Yahoo quotes
Date: Thu, 10 May 2012 16:26:22 +0200
To: bug-Finance-Quote [...] rt.cpan.org
From: Gabriele <gabriele.mailing [...] rvmgroup.it>
I tried to get quotes for a fund symbol like 2212358.SW on http://finance.yahoo.com. I noticed that there is no "price" value, but only "last". I think it's better to transparently store "last" in "price" if the latter is empty. See the sample code below cat ./tt.pl #!/usr/bin/perl use Finance::Quote; my $q = Finance::Quote->new(); my $source = "yahoo"; my $symbol = "2212358.SW"; my %data = $q->fetch($source, $symbol); print "Last of $symbol (retrivied from $source) is: '" . $data{$symbol, 'last'} . "'\n"; print "Price of $symbol (retrivied from $source) is: '" . $data{$symbol, 'price'} . "'\n"; -- Gabriele
Hi! Funds are currently not well supported for yahoo.com. Your request is espected behaviour, namely 'price' returns 'last' if 'price' is not defined. However, if you add following line in your code: print "$symbol retrieval ".($data{$symbol,'success'} ? "OK":"FAILED")."\n"; you'll see that the retrieval didn't succeed. The problem is that there was no date returned and therefor the data is rejected. Now, we should debug this and check how to retrieve the date in this weird case :/ -- Erik
2212358.SW can now be retrieved by using yahoo_json ! Fixed in version 1.27 -- Erik