Skip Menu |

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

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

People
Owner: eco [...] ecocode.net
Requestors: rt.cpan.simon [...] arlott.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.35
Fixed in: 1.37



Subject: Finance::Quote::FTfunds does not detect GBX correctly
http://funds.ft.com/uk/Tearsheet/Summary?s=GB00B7W6PR65 redirects to http://funds.ft.com/uk/Tearsheet/Summary?s=GB00B7W6PR65:GBP which has the price in GBX: 277.35 2.04 / 0.74% NAV in GBX This is incorrectly detected as GBP and so the price is not adjusted.
From: rt.cpan.simon [...] arlott.org
Patch to detect the currency using the "NAV in XXX" text attached. I removed the previous "code:XXX" check as I don't want it to go back to detecting the wrong currency if the "NAV in XXX" text changes.
Subject: FTfunds.patch
--- /usr/share/perl5/Finance/Quote/FTfunds.pm 2014-06-17 07:06:24.000000000 +0100 +++ .perl-lib/Finance/Quote/FTfunds.pm 2014-10-25 10:33:12.000000000 +0100 @@ -231,14 +231,11 @@ } # Find the currency my $currency; - if ($webdoc->content =~ - m[($code):([A-Z]{3})] ) - { - - $currency = $2; - } + if ($webdoc->content =~ m[>NAV [Ii][Nn] ([A-Z]{3})<]) { + $currency = $1; + } if (!defined($currency)) { # serious error, report it and give up $fundquote {$code,"success"} = 0;
From: paul [...] city-fan.org
On Sat Oct 25 05:35:12 2014, SimonArlott wrote: Show quoted text
> Patch to detect the currency using the "NAV in XXX" text attached. > > I removed the previous "code:XXX" check as I don't want it to go back > to detecting the wrong currency if the "NAV in XXX" text changes.
Alternative patch (works for me):
Subject: Finance-Quote-1.37-rt99783.patch
--- lib/Finance/Quote/FTfunds.pm +++ lib/Finance/Quote/FTfunds.pm @@ -233,7 +233,7 @@ # Find the currency my $currency; if ($webdoc->content =~ - m[($code):([A-Z]{3})] ) + m[<th>(Price currency)</th><td>([A-Z]{3})</td>] ) { $currency = $2;
Thanks. Patch applied -- Erik