Hello community,
here is the log from the commit of package perl-Finance-Quote for openSUSE:Factory checked in at 2012-01-25 10:40:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Finance-Quote (Old)
and /work/SRC/openSUSE:Factory/.perl-Finance-Quote.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Finance-Quote", Maintainer is "sbrabec@suse.com"
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Finance-Quote/perl-Finance-Quote.changes 2011-11-21 12:40:21.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.perl-Finance-Quote.new/perl-Finance-Quote.changes 2012-01-25 10:40:37.000000000 +0100
@@ -1,0 +2,20 @@
+Mon Jan 16 18:43:18 CET 2012 - sbrabec@suse.cz
+
+- Updated to the current upstream GIT snapshot (many updates for
+ server changes).
+- Added fixes from upstream bug tracker:
+ * Fix GoldMoney server changes, add palladium (CPAN#64897).
+ * Rewrite Finance Canada after server changes (CPAN#57401).
+ * Partial rewrite ov VWD due to server changes (CPAN#62619).
+ * Fix Cdnfundlibrary to retrieve newest NAV (CPAN#66235).
+ * Fix use of /tmp file in IndiaMutual (CPAN#70690).
+ * New modules:
+ * Comdirect (CPAN#61750)
+ * Stooq (CPAN#64474)
+ * FTFunds (CPAN#65269)
+- Added Fedora fix:
+ * Fix TIAA-CREF (Redhat#668935).
+- Added all Debian fixes.
+- Yahoo fixes ported to the upstream GIT.
+
+-------------------------------------------------------------------
Old:
----
Finance-Quote-1.17.tar.gz
New:
----
finance-quote-git20110222.tar.bz2
perl-Finance-Quote-57401-financecanada.patch
perl-Finance-Quote-61750-comdirect.patch
perl-Finance-Quote-62619-vwd.patch
perl-Finance-Quote-64474-stooq.patch
perl-Finance-Quote-64897-0001-adopted-to-site-changes.patch
perl-Finance-Quote-64897-0002-support-palladium-lookup.patch
perl-Finance-Quote-65269-ftfunds.patch
perl-Finance-Quote-66235-Cdnfundlibrary-row.patch
perl-Finance-Quote-70690-IndiaMutual-temp-del.patch
perl-Finance-Quote-70690-IndiaMutual-temp.patch
perl-Finance-Quote-debian-02_typo.patch
perl-Finance-Quote-debian-03_whatis.patch
perl-Finance-Quote-debian-04_deka.patch
perl-Finance-Quote-debian-06_seb.patch
perl-Finance-Quote-debian-08_deka.patch
perl-Finance-Quote-debian-10_whatis.patch
perl-Finance-Quote-fedora-tiaa-cref.patch
perl-Finance-Quote-fsf-address.patch
perl-Finance-Quote-goldmoney-decimal-point.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Finance-Quote.spec ++++++
--- /var/tmp/diff_new_pack.fXzp0g/_old 2012-01-25 10:40:39.000000000 +0100
+++ /var/tmp/diff_new_pack.fXzp0g/_new 2012-01-25 10:40:39.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package perl-Finance-Quote
#
-# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,13 +24,33 @@
Group: Development/Libraries/Perl
AutoReqProv: on
Requires: perl-Crypt-SSLeay perl-libwww-perl
-Requires: perl-HTML-Parser perl-HTML-TableExtract perl-HTML-Tree
+Requires: perl-HTML-Parser perl-HTML-TableExtract perl-HTML-TokeParser-Simple perl-HTML-Tree
Requires: perl-URI perl-XML-SAX
Summary: Provides access to time-delayed stockquotes
-Version: 1.17
+%define gitversion 20110222
+Version: 1.17.0.%{gitversion}
Release: 9
-Source: Finance-Quote-%{version}.tar.gz
+Source: finance-quote-git%{gitversion}.tar.bz2
Patch: perl-Finance-Quote-LeRevenu.patch
+Patch10: perl-Finance-Quote-debian-02_typo.patch
+Patch11: perl-Finance-Quote-debian-03_whatis.patch
+Patch12: perl-Finance-Quote-debian-04_deka.patch
+Patch13: perl-Finance-Quote-debian-06_seb.patch
+Patch14: perl-Finance-Quote-debian-08_deka.patch
+Patch15: perl-Finance-Quote-debian-10_whatis.patch
+Patch30: perl-Finance-Quote-fedora-tiaa-cref.patch
+Patch60: perl-Finance-Quote-66235-Cdnfundlibrary-row.patch
+Patch61: perl-Finance-Quote-70690-IndiaMutual-temp.patch
+Patch62: perl-Finance-Quote-65269-ftfunds.patch
+Patch63: perl-Finance-Quote-64897-0001-adopted-to-site-changes.patch
+Patch64: perl-Finance-Quote-64897-0002-support-palladium-lookup.patch
+Patch65: perl-Finance-Quote-57401-financecanada.patch
+Patch66: perl-Finance-Quote-61750-comdirect.patch
+Patch67: perl-Finance-Quote-62619-vwd.patch
+Patch68: perl-Finance-Quote-64474-stooq.patch
+Patch69: perl-Finance-Quote-70690-IndiaMutual-temp-del.patch
+Patch100: perl-Finance-Quote-fsf-address.patch
+Patch101: perl-Finance-Quote-goldmoney-decimal-point.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{perl_requires}
BuildRequires: perl
@@ -49,8 +69,28 @@
Paul Fenwick
%prep
-%setup -q -n Finance-Quote-%{version}
+%setup -q -n finance-quote
%patch -p1
+%patch10
+%patch11
+%patch12
+%patch13
+%patch14
+%patch15
+%patch30 -p1
+%patch60 -p1
+%patch61 -p1
+%patch62 -p1
+%patch63 -p1
+%patch64 -p1
+%patch65 -p1
+%patch66 -p1
+%patch67 -p1
+%patch68 -p1
+%patch69 -p1
+%patch100 -p1
+%patch101 -p1
+rm lib/Finance/*.orig lib/Finance/Quote/*.orig
mv Documentation/README Documentation/README2
%build
++++++ perl-Finance-Quote-57401-financecanada.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=57401
Date: Tue May 11 20:56:07 2010 paul.polak [...] gmail.com - Ticket created [Reply] [Forward]
Subject: FinanceCanada.pm module
The FinanceCanada module was broken since canada.finance.com changed its
website for financial information. The new module now uses
www.financialpost.com, and can retrieve quotes for both stocks and
mutual funds. The module can retrieve information from multiple
exchanges (TOR, NYSE, etc.) and because symbols are not unique
among different exchanges, it is worthwhile to check the stock symbol /
ID on the financialpost.com site before using the module to ensure
correct information is retrieved. Attached is the updated F::Q module
and a testing module.
Index: finance-quote/lib/Finance/Quote/FinanceCanada.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/FinanceCanada.pm
+++ finance-quote/lib/Finance/Quote/FinanceCanada.pm
@@ -7,21 +7,24 @@
# Version 0.2 Rewrite by David Hampton for
# changed web site.
#
+# Version 0.3 Rewrite by linux_slacker for
+# changed web site
package Finance::Quote::FinanceCanada;
require 5.004;
use strict;
-use vars qw/ $VERSION / ;
-
use LWP::UserAgent;
use HTTP::Request::Common;
-use HTML::TableExtract;
+use HTML::TokeParser::Simple;
+
-$VERSION = '1.17';
-my $FINANCECANADA_MAINURL = ("http://finance.canada.com/");
-my $FINANCECANADA_URL = "http://stockgroup.canada.com/sn_overview.asp?symbol=T.";
+my $VERSION = '0.3';
+my $FINANCECANADA_MAINURL = ("http://www.financialpost.com/");
+my $FINANCECANADA_STOCKSYM_URL = "http://idms.financialpost.com/stocks/company_overview.idms?SYMBOL=";
+my $FINANCECANADA_STOCKID_URL = "http://idms.financialpost.com/stocks/company_overview.idms?ID_NOTATION=";
+my $FINANCECANADA_FUND_URL = "http://idms.financialpost.com/funds/snapshot.idms?FUND_KEY=";
sub methods {
return (canada => \&financecanada,
@@ -33,8 +36,7 @@ sub labels {
my @labels = qw/method source name symbol currency last date isodate nav price/;
return (canada => \@labels,
financecanada => \@labels);
-}
-
+}
sub financecanada {
@@ -47,122 +49,235 @@ sub financecanada {
my $ua = $quoter->user_agent;
foreach my $symbol (@symbols) {
- my ($day_high, $day_low, $year_high, $year_low);
+ $info{$symbol, "success"} = 0;
+ $info{$symbol, "symbol"} = $symbol;
+ $info{$symbol, "method"} = "financecanada";
+ $info{$symbol, "source"} = $FINANCECANADA_MAINURL;
+
+ my @sites;
+
+ # Figure out which URLs we should use
+ if ($symbol =~ /^[A-Za-z]/) {
+ @sites = ($FINANCECANADA_STOCKSYM_URL);
+ }
+ else {
+ @sites = ($symbol =~ /^\d{5}$/)
+ ? ($FINANCECANADA_FUND_URL, $FINANCECANADA_STOCKID_URL)
+ : ($FINANCECANADA_STOCKID_URL, $FINANCECANADA_FUND_URL);
+ }
- $info{$symbol, "success"} = 0;
- $info{$symbol, "symbol"} = $symbol;
- $info{$symbol, "method"} = "financecanada";
- $info{$symbol, "source"} = $FINANCECANADA_MAINURL;
-
- # Pull the data from the web site
- my $url = $FINANCECANADA_URL.$symbol;
- # print $url;
- my $response = $ua->request(GET $url);
- # print $response->content;
- if (!$response->is_success) {
- $info{$symbol, "errormsg"} = "Error contacting URL";
- next;
- }
-
- # Parse the page looking for the table containing the full
- # name of the stock
- my $te = new HTML::TableExtract( depth => 2, count => 0);
- $te->parse($response->content);
-
- # debug
-# foreach my $ts ($te->table_states) {
-# print "\n***\n*** Table (", join(',', $ts->coords), "):\n***\n";
-# foreach my $row ($ts->rows) {
-# print join(',', @$row), "\n";
-# }
-# }
-
- foreach my $ts ($te->table_states) {
- my $row = $ts->row(0);
- $info{$symbol, "name"} = $row->[0]
- if ($row->[0] =~ s/^.([\w\s]+).*/$1/);
- }
- if (!defined($info{$symbol, "name"})) {
- $info{$symbol, "errormsg"} = "Invalid symbol";
- next;
- }
+ foreach my $root (@sites) {
+ my $url = $root.$symbol;
- # Parse the page looking for the table containing the quote
- # details
- $te = new HTML::TableExtract(headers => [qw(Quote)],
- slice_columns => 0);
- $te->parse($response->content);
-
- # debug
-# foreach my $ts ($te->table_states) {
-# print "\n***\n*** Table (", join(',', $ts->coords), "):\n***\n";
-# foreach my $row ($ts->rows) {
-# print join(',', @$row), "\n";
-# }
-# }
-
- # Now parse the quote details. This method of parsing is
- # independent of which row contains which data item, so if the
- # web site reorders these it won't impact this code.
- foreach my $ts ($te->table_states) {
- foreach my $row ($ts->rows) {
-
- # Remove leading and trailing white space
- $row->[0] =~ s/^\s*(.+?)\s*$/$1/ if defined($row->[0]);
- $row->[1] =~ s/^\s*(.+?)\s*$/$1/ if defined($row->[1]);
-
- # Map the row into our data array
- for ($row->[0]) {
- /^Last Traded/ && do { s/Last Traded: (.*) ../$1/;
- $quoter->store_date(\%info, $symbol, { usdate => $_}); };
- /^Last$/ && do { $info{$symbol, "last"} = $row->[1];
- $info{$symbol, "price"} = $row->[1];
- $info{$symbol, "nav"} = $row->[1];
- last; };
- /^Open$/ && do { $info{$symbol, "open"} = $row->[1]; last; };
- /^Bid$/ && do { $info{$symbol, "bid"} = $row->[1]; last; };
- /^Ask$/ && do { $info{$symbol, "ask"} = $row->[1]; last; };
- /^% Change/ && do { $info{$symbol, "p_change"} = $row->[1];
- $info{$symbol, "p_change"} =~ s/%//;
- last; };
- /^Volume/ && do { $info{$symbol, "volume"} = $row->[1]; last; };
- /^Close/ && do { $info{$symbol, "close"} = $row->[1]; last; };
-
- /^Day High$/ && do { $info{$symbol, "high"} = $row->[1]; last; };
- /^Day Low$/ && do { $info{$symbol, "low"} = $row->[1]; last; };
- /^Year High$/ && do { $year_high = $row->[1]; last; };
- /^Year Low$/ && do { $year_low = $row->[1]; last; };
-
- $info{$symbol, "success"} = 1;
- };
- }
- }
+ my $response = $ua->request(GET $url);
+
+ if (!$response->is_success) {
+ $info{$symbol, "errormsg"} = "Error contacting URL";
+ next;
+ }
- if ($info{$symbol, "success"} == 1) {
- $info{$symbol, "currency"} = "CAD";
- foreach (keys %info) {
- $info{$_} =~ s/\$//;
- }
- $info{$symbol, "day_range"} = $info{$symbol, "low"} . " - " . $info{$symbol, "high"}
- if (defined($info{$symbol, "high"}) && defined($info{$symbol, "low"}));
-
- if (defined($year_high) && defined($year_low)) {
- $info{$symbol, "year_range"} = "$year_low - $year_high";
- }
- } else {
- $info{$symbol, "errormsg"} = "Cannot parse quote data";
+ my $parser = HTML::TokeParser::Simple->new(string => $response->content);
+ my %ret = ($root eq $FINANCECANADA_FUND_URL)
+ ? ParseFund(\$parser) : ParseStock(\$parser);
+
+ for my $key (keys %ret) {
+ $info{$symbol, $key} = $ret{$key};
+ }
+
+ last if ($info{$symbol, "success"});
+ }
+
+ if ($info{$symbol, "success"} == 1) {
+
+ if (!defined($info{$symbol, "currency"})) {
+ $info{$symbol, "currency"} = "CAD";
+ }
+
+ # Use current day at GMT time, since no date given with quote
+ my ($day, $month, $year) = getGMTDate();
+ $quoter->store_date(\%info, $symbol,
+ {month => $month, day => $day, year => $year});
+
+ $info{$symbol, "timezone"} = "GMT";
+
+ foreach (keys %info) {
+ $info{$_} =~ s/\$//;
+ }
+
+ if (defined($info{$symbol, "high"}) && defined($info{$symbol, "low"})) {
+ $info{$symbol, "day_range"} = $info{$symbol, "low"} . " - " . $info{$symbol, "high"};
+ }
+
+ if (defined($info{$symbol, "year_high"}) && defined($info{$symbol, "year_low"})) {
+ $info{$symbol, "year_range"} = $info{$symbol, "year_low"}." - ".$info{$symbol, "year_high"};
+ }
+ }
+ else {
+ $info{$symbol, "errormsg"} = "Cannot parse quote data";
+ }
}
+
+ return wantarray() ? %info : \%info;
+}
+
+sub ParseStock($) {
+ my $ref = shift;
+ my $parser = $$ref;
+
+ my %info;
+
+ while (my $div = $parser->get_tag('div')) {
+ my $id = $div->get_attr('id');
+
+ if ($id eq "IDMScontainer") {
+ my $header = $parser->get_tag('h2');
+ my $name = trim($parser->get_trimmed_text('/h2'));
+
+ $name =~ s/ //g;
+
+ # Should have at least 1 alphabetic character...
+ last unless ($name =~ /[A-Za-z]/);
+
+ $info{"name"} = $name;
+ }
+ elsif ($id eq "fundProfile") {
+ for (my $i=0; $i<6; $i++) {
+ my $span = $parser->get_tag('span');
+ my $class = $span->get_attr('class');
+
+ if ($class eq "price") {
+ my $price = removedollar($parser->get_trimmed_text('/span'));
+
+ last unless ($price =~ /^\d/);
+
+ $info{"price"} = $price;
+ $info{"success"} = 1;
+ }
+ elsif (($class eq "positive") || ($class eq "negative")) {
+ my $raw = $parser->get_trimmed_text('/span');
+ $raw =~ /^(\-)?\$((\d)+(\.\d\d))/;
+ $info{"net"} = $1.$2;
+ }
+ elsif ($class eq "high") {
+ $info{"high"} = removedollar($parser->get_trimmed_text('/span'));
+ }
+ elsif ($class eq "low") {
+ $info{"low"} = removedollar($parser->get_trimmed_text('/span'));
+ }
+ elsif ($class eq "volume") {
+ $info{"volume"} = $parser->get_trimmed_text('/span');
+ }
+ }
+ }
+ elsif ($id eq "quoteDetail") {
+ for (my $i=0; $i<18; $i++) {
+ my $th = $parser->get_tag('th');
+
+ if ($i == 3) {
+ $info{"year_high"} = removedollar($parser->get_trimmed_text('th'));
+ }
+ elsif ($i == 5) {
+ $info{"cap"} = removedollar($parser->get_trimmed_text('th'));
+ }
+ elsif ($i == 9) {
+ $info{"year_low"} = removedollar($parser->get_trimmed_text('th'));
+ }
+ elsif ($i == 15) {
+ $info{"exchange"} = $parser->get_trimmed_text('th');
+ }
+ }
+ }
+ }
+
+ return %info;
+}
+
+sub ParseFund($) {
+ my $ref = shift;
+ my $parser = $$ref;
+
+ my %info;
+
+ my $idmscount = 0;
+
+ while (my $div = $parser->get_tag('div')) {
+ my $id = $div->get_attr('id');
+
+ if ($id eq "IDMScontainer") {
+ $idmscount++;
+
+ if ($idmscount == 1) {
+ my $header = $parser->get_tag('h2');
+ my $name = trim($parser->get_trimmed_text('/h2'));
+
+ $name =~ s/ //g;
+
+ # Should have at least 1 alphabetic character...
+ last unless ($name =~ /[A-Za-z]/);
+
+ $info{"name"} = $name;
+ }
+ else {
+ while (my $tr = $parser->get_tag('tr')) {
+ my $tdcount = 0;
+
+ while (my $td = $parser->get_tag('td')) {
+ $tdcount++;
+
+ if ($tdcount == 1) {
+ my $price = removedollar($parser->get_trimmed_text('/td'));
+
+ last unless ($price =~ /^\d/);
+
+ $info{"nav"} = $price;
+ $info{"success"} = 1;
+ }
+ elsif ($tdcount == 2) {
+ $info{"net"} =
+ removedollar($parser->get_trimmed_text('/span'));
+ }
+ elsif ($tdcount == 7) {
+ $info{"currency"} =
+ $parser->get_trimmed_text('/td');
+ }
+ }
+ }
+ }
+ }
}
- return wantarray() ? %info : \%info;
+ return %info;
+}
+
+sub getGMTDate() {
+ my @timeData = gmtime(time);
+ my $day = $timeData[3];
+ my $month = 1 + $timeData[4];
+ my $year = 1900 + $timeData[5];
+
+ return ($day, $month, $year);
+}
+
+sub trim($) {
+ my $string = shift;
+ $string =~ s/^\s+//;
+ $string =~ s/\s+$//;
+ return $string;
+}
+
+sub removedollar($) {
+ my $raw = shift;
+ $raw =~ /^\$?(.*)$/;
+ return $1;
}
+
1;
=head1 NAME
-Finance::Quote::FinanceCanada - Obtain stock and mutual fund prices from
-finance.canada.com
+Finance::Quote::FinanceCanada - Obtain stock and fund prices
+from www.financialpost.com
=head1 SYNOPSIS
@@ -171,25 +286,30 @@ finance.canada.com
$q = Finance::Quote->new;
# Can failover to other methods
- %quotes = $q->fetch("canada", "stock_fund-code");
-
+ %quotes = $q->fetch("canada", "stock_code");
+
# Use this module only
- %quotes = $q->fetch("financecanada", "stock_fund-code");
+ %quotes = $q->fetch("financecanada", "stock_code");
=head1 DESCRIPTION
-This module obtains information about Canadian Stock and Mutual Funds from
-finanace.canada.com. The information source "canada" can be used if the
+This module obtains information about Canadian stocks and funds from
+www.financialpost.com. The information source "canada" can be used if the
information source is unimportant, or "financecanada" to specifically use
-finance.canada.com.
+www.financialpost.com.
-=head1 STOCK_FUND-CODE
+=head1 STOCK_CODE
-Canadian stocks/mutual funds do not have a unique symbol identifier. This
-module uses the symbols as used on finance.canada.com. The simplest way
-to fetch the ID for a particular stock/fund is to go to finance.canada.com,
-search for your particular stock or mutual fund, and note the symbol ID.
-This is helpfully provided by the site in their returned HTML quote.
+Canadian stocks/mutual funds do not have a unique symbol identifier on
+www.financialpost.com. For example, the symbol "T" can refer to stock
+quotes from either "Telus" on the Toronto Stock Exchange (TOR) or
+"AT&T Inc." on NYSE. The simplest way to fetch the ID for a particular
+stock/fund is to go to www.financialpost.com, search for your
+particular stock/fund, and note the symbol 'id' in the site URL.
+
+Note that www.financialpost.com uses different URLs for stocks and funds.
+This module attempts to guess which URL to use based regular expressions tests
+on the symbol.
=head1 LABELS RETURNED
@@ -199,9 +319,8 @@ method source name symbol currency date
=head1 SEE ALSO
-Finance Canada.com website - http://finance.canada.com/
+Finance Canada.com website - http://www.financialpost.com/
Finance::Quote
=cut
-
Index: finance-quote/t/financecanada.t
===================================================================
--- finance-quote.orig/t/financecanada.t
+++ finance-quote/t/financecanada.t
@@ -1,36 +1,42 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl
+
use strict;
-use Test::More;
-use Finance::Quote;
+use Test;
+use Data::Dumper;
-if (not $ENV{ONLINE_TEST}) {
- plan skip_all => 'Set $ENV{ONLINE_TEST} to run this test';
-}
+BEGIN {plan tests => 22};
+
+use Finance::Quote;
-plan tests => 26;
+# Test FinanceCanada functions
-# Test Finance Canada functions.
+my $q = Finance::Quote->new();
+my @stocks = ("RY", "T", "15213", "283808");
-my $q = Finance::Quote->new();
-my @stocks = ("NT","XIU","UUU", "PCA");
-my $year = (localtime())[5] + 1900;
-my $lastyear = $year - 1;
+my %regexps = (
+ RY => qr/\bROYAL\b/,
+ T => qr/\bAT\&T\b/,
+ 15213 => qr/\bTD Canadian Index\b/,
+ 283808 => qr/\bSPRINT\b/,
+);
my %quotes = $q->fetch("financecanada", @stocks);
ok(%quotes);
-# Check that the name and nav are defined for all of the stocks.
foreach my $stock (@stocks) {
- ok($quotes{$stock,"price"} > 0);
- ok(length($quotes{$stock,"name"}));
- ok($quotes{$stock,"success"});
- ok($quotes{$stock, "currency"} eq "CAD");
- ok(substr($quotes{$stock,"isodate"},0,4) == $year ||
- substr($quotes{$stock,"isodate"},0,4) == $lastyear);
- ok(substr($quotes{$stock,"date"},6,4) == $year ||
- substr($quotes{$stock,"date"},6,4) == $lastyear);
+ my $name = $quotes{$stock, "name"};
+ print "#Testing $stock: $name\n";
+
+ my $regexp = $regexps{$stock};
+ ok($name =~ /$regexp/i);
+
+ ok($quotes{$stock, "method"} eq 'financecanada');
+
+ ok(($quotes{$stock, "price"} > 0) || ($quotes{$stock, "nav"} > 0));
+ ok($quotes{$stock, "net"} =~ /^-?\d+\.\d+$/);
+ ok($quotes{$stock, "success"});
}
# Check that a bogus stock returns no-success.
%quotes = $q->fetch("financecanada", "BOGUS");
-ok(! $quotes{"BOGUS","success"});
+ok(! $quotes{"BOGUS", "success"});
++++++ perl-Finance-Quote-61750-comdirect.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=61750
Date: Wed Sep 29 06:41:51 2010 http://www.google.com/profiles/lars.eggert - Ticket created [Reply] [Forward]
Subject: Finance::Quote Module for Comdirect Bank
Available at http://fit.nokia.com/lars/soft ware/Comdirect.pm
Index: finance-quote/MANIFEST
===================================================================
--- finance-quote.orig/MANIFEST
+++ finance-quote/MANIFEST
@@ -25,6 +25,7 @@ lib/Finance/Quote/ASX.pm
lib/Finance/Quote/BMONesbittBurns.pm
lib/Finance/Quote/Bourso.pm
lib/Finance/Quote/Cdnfundlibrary.pm
+lib/Finance/Quote/Comdirect.pm
lib/Finance/Quote/Cominvest.pm
lib/Finance/Quote/Currencies.pm
lib/Finance/Quote/Deka.pm
Index: finance-quote/lib/Finance/Quote/Comdirect.pm
===================================================================
--- /dev/null
+++ finance-quote/lib/Finance/Quote/Comdirect.pm
@@ -0,0 +1,201 @@
+# Finance::Quote Perl module to retrieve prices from Comdirect Bank
+# Copyright (C) 2010 Lars Eggert
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+#
+# $Id: Comdirect.pm,v 1.5 2010/12/07 13:46:44 eggert Exp $
+
+package Finance::Quote::Comdirect;
+
+use warnings;
+use strict;
+use open IO => ':utf8';
+use open ':std';
+
+use HTML::TokeParser::Simple;
+use Data::Dumper;
+
+use vars qw($VERSION);
+$VERSION = '1.17';
+#my $URL = "http://isht.comdirect.de/html/detail/main.html?";
+my $URL = "http://www.comdirect.de/inf/search/all.html?";
+
+sub methods { return (comdirect => \&comdirect); }
+sub labels { return (comdirect => [qw/name date price last method/]); }
+
+# Convert number separators to US values and strip other characters
+sub conv {
+ $_ = shift;
+ s/\./@/g;
+ s/,/\./g;
+ s/@/,/g;
+ s/[^0-9,.]//g;
+ return $_;
+}
+
+sub comdirect {
+ my $quoter = shift;
+ my @symbols = @_;
+ my $ua = $quoter->user_agent();
+ my %info;
+
+ foreach my $s (@symbols) {
+ my $search = $s;
+ again:
+ $info{$s, "url"} = $URL . "SEARCH_VALUE=" . $search;
+# print $info{$s, "url"} . "\n";
+ my $response = $ua->get($info{$s, "url"});
+ $info{$s, "success"} = 0;
+
+ if (not $response->is_success) {
+ $info{$s, "errormsg"} = "HTTP failure";
+ next;
+ }
+
+ foreach my $which (qw(p td)) {
+ my $tp = HTML::TokeParser::Simple->new(
+ string => $response->content
+ );
+
+ # get stock title
+ my $tag = $tp->get_tag("span");
+ if (defined $tag->get_attr("title")) {
+ $info{$s, "name"} = $tag->get_attr("title");
+ }
+
+ my $p = "";
+ while ($tag = $tp->get_tag($which)) {
+ my $t = $tp->get_trimmed_text("/$which");
+# print "$p --- $t\n";
+
+ $info{$s, "symbol"} = $t
+ if $p =~ "Symbol|ISIN";
+ $info{$s, "open"} = conv($t)
+ if $p =~ /Er.ffnung/;
+ $info{$s, "close"} = conv($t)
+ if $p eq "Schluss Vortag";
+ $info{$s, "year_high"} = conv($t)
+ if $p eq "52W Hoch";
+ $info{$s, "year_low"} = conv($t)
+ if $p eq "52W Tief";
+
+ $info{$s, "high"} = conv($t) if $p eq "Hoch";
+ $info{$s, "low"} = conv($t) if $p eq "Tief";
+ $info{$s, "bid"} = conv($t) if $p eq "Geld";
+ $info{$s, "ask"} = conv($t) if $p eq "Brief";
+
+ $info{$s, "exchange"} = $1
+ if $t =~ /B.rse: (.*)/;
+ $info{$s, "p_change"} = conv($t)
+ if $p eq "Diff. Vortag";
+
+ # Volume is in millions sometimes, and sometimes not
+ # $info{$s, "volume"} = conv($t)
+ # if $p =~ /Tages-Vol\./;
+
+ # currency is sometimes missing from this field
+ $info{$s, "currency"} = substr($t, -3)
+ if $p =~ /Uhr$/;
+
+ # set currency from W�hrung if it's invalid
+ $info{$s, "currency"} = substr(uc $t, -3)
+ if $p =~ /W.hrung/ and
+ $info{$s, "currency"} !~ /[A-Z]{3}/;
+
+ if ($p eq "Zeit" and $t ne "--"
+ and not defined $info{$s, "time"}) {
+ # hope date format doesn't change again
+ $t =~ /(.{8})(.{5})/;
+ my ($date, $time) = ($1, $2);
+# print "$date -- $time";
+ $quoter->store_date(\%info, $s,
+ {eurodate => $date}
+ );
+ $info{$s, "time"} = $time;
+ }
+
+ $info{$s, "last"} =
+ $info{$s, "price"} = conv($t)
+ if $p =~ /Aktuell|R.cknahmepreis/;
+
+ $p = $t;
+ }
+
+ if ($info{$s, "low"} and $info{$s, "high"}) {
+ $info{$s, "day_range"} =
+ $info{$s, "low"} . " - " .
+ $info{$s, "high"};
+ }
+
+ if ($info{$s, "year_low"} and $info{$s, "year_high"}) {
+ $info{$s, "year_range"} =
+ $info{$s, "year_low"} . " - " .
+ $info{$s, "year_high"};
+ }
+
+ # set price from bid and ask if undefined
+ $info{$s, "price"} = $info{$s, "ask"}
+ if not $info{$s, "price"} and
+ not $info{$s, "last"} and
+ not $info{$s, "nav"};
+ }
+
+ # sometime during fall 2010, comdirect stopped supporting
+ # "symbol.exchange" searches, so retry a price search if the
+ # exchange indicated in the symbol doesn't return anything
+ if (not $info{$s, "price"} and not $info{$s, "last"} and
+ not $info{$s, "nav"} and $search =~ /\./) {
+ $search =~ s/([^\.]+)\..*/$1/;
+ goto again;
+ }
+
+ $info{$s, "method"} = "comdirect";
+ $info{$s, "success"} = 1;
+# print Dumper \%info;
+ }
+ return wantarray ? %info : \%info;
+}
+
+1;
+
+=head1 NAME
+
+Finance::Quote::Comdirect - Obtain fonds quotes from Comdirect Bank.
+
+=head1 SYNOPSIS
+
+ use Finance::Quote;
+
+ $q = Finance::Quote->new("Comdirect");
+
+ %info = Finance::Quote->fetch("comdirect", "DE0008474511");
+
+=head1 DESCRIPTION
+
+This module obtains fund prices from Comdirect Bank, http://www.comdirect.de/.
+The Comdirect website supports retrieval by name, WKN or ISIN.
+
+=head1 LABELS RETURNED
+
+The following labels may be returned by Finance::Quote::Comdirect:
+name, date, price, last, method.
+
+=head1 SEE ALSO
+
+Comdirect Bank, http://www.comdirect.de/
+
+Finance::Quote;
+
+=cut
++++++ perl-Finance-Quote-62619-vwd.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=62619
Mon Nov 01 12:31:49 2010 Biggles [...] gmx.de - Ticket created [Reply] [Forward]
Subject: VWD.pm completely changed again
Date: Mon, 01 Nov 2010 17:31:36 +0100
To: bug-Finance-Quote [...] rt.cpan.org
From: Biggles
Hi all, VWD.pm needs to be changed again after multiple changes on the
finanztreff.de pages.
As I require some stocks from that site, I have "rewritten" the code.
I'm not a programmer, so it's not polished, but at least it works for
me.
Maybe someone else can make use of it ...
Greetings Biggles
Sat Nov 13 03:04:41 2010 Thomas.Eschenbacher [...] gmx.de - Correspondence added [Reply] [Forward]
From: Thomas.Eschenbacher [...] gmx.de
Hello, I attached my updated version of VWD.pm, which additionally
provides values for the "symbol"(ISIN), the "name" and the "time" field.
Thomas
Index: finance-quote/lib/Finance/Quote/VWD.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/VWD.pm
+++ finance-quote/lib/Finance/Quote/VWD.pm
@@ -8,6 +8,7 @@
# Copyright (C) 2000, Volker Stuerzl
# Copyright (C) 2003,2005,2006 J�rg Sommer
# Copyright (C) 2008 Martin Kompf (skaringa at users.sourceforge.net)
+# Copyright (C) 2011 Thomas Eschenbacher (thomas.eschenbacher at gmx.de)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -115,25 +116,28 @@ sub vwd
$quoter->store_date(\%info, $fund, {day => $1, month => $2});
}
+ # wpHeadLine contains a <h1> with the name
+ my $wpheadline = $tree->look_down(
+ "_tag", "div",
+ "class", "wpHeadLine"
+ );
+ next if not $wpheadline;
+ my @name = $wpheadline->find("h1");
+ $info{$fund, "name"} = $name[0]->as_trimmed_text;
+
# all other info below <div class=contentContainer>
my $content = $tree->look_down(
"_tag", "div",
"class", "contentContainer"
);
next if not $content;
-
- # <h1> contains price, time, name, and symbol
- my $head = $content->look_down(
- "_tag", "div",
- "class", "wpHeadline"
- );
- next if not $head;
-
- my $wpkurs = $head->look_down(
+ # wpKurs
+ my $wpkurs = $tree->look_down(
"_tag", "div",
"class", "wpKurs"
);
next if not $wpkurs;
+
my $time = $wpkurs->look_down(
"_tag", "div",
"class", "datum"
@@ -147,28 +151,29 @@ sub vwd
next if not $kurs;
$info{$fund, "price"} = $info{$fund, "last"} = trimtr($kurs->as_text);
- foreach ($head->descendants) {
- $_->delete;
- }
-
- my $wpsymbol = $content->look_down(
- "_tag", "ul",
- "class", "wpInfo"
- );
- if ($wpsymbol) {
- my @li = $wpsymbol->find("li");
- if ($li[4]->as_text =~ /WKN:(\w+)/) {
- $info{$fund, "symbol"} = $1;
- }
- }
+ # scrollup contains WKN, ISIN, Symbol
+ my $scrollup = $tree->look_down(
+ "_tag", "li",
+ "id", "scrollup"
+ );
+ next if not $scrollup;
+ my @scroll = $scrollup->find("span");
+ # $scroll[0] -> WKN
+ # $scroll[2] -> ISIN
+ # $scroll[4] -> Symbol
+ my @isin = split(/:/,$scroll[2]->as_text);
+ $info{$fund, "symbol"} = $isin[1];
# <ul> contains currency as 3rd <li>
my $wpinfo = $content->look_down(
- "_tag", "span",
- "class", "whrg"
+ "_tag", "table",
+ "class", "portraitKurse"
);
if ($wpinfo) {
- $info{$fund, "currency"} = substr($wpinfo->as_text, 0, 3);
+ my @tr = $wpinfo->find("tr");
+ my @td = $tr[0]->find("td");
+ # $td[1] also contains current price
+ $info{$fund, "currency"} = $td[2]->as_text;
}
# fund ok
++++++ perl-Finance-Quote-64474-stooq.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=64474
Tue Jan 04 16:34:23 2011 michal.fita [...] gmail.com - Ticket created [Reply] [Forward]
Subject: New module suggestion
Date: Tue, 4 Jan 2011 22:34:15 +0100
To: bug-Finance-Quote [...] rt.cpan.org
From: Michał Fita
Hi Finance::Quote Developers,
I would like to suggest a new module for Stooq.com service. This is
Polish website (they are currently being localized to English) related
to stocks exchange markets, not only GPW (Warsaw Stock Exchange), but
also others. However, they provide quite useful interface for gathering
information about current stocks prices on GPW in Poland. So I prepared
a module which I am currently use together with GnuCash with success. I
will send you future updates to this module if I ever implement them. I
am not an Perl guru, even more am I not programming in Perl at all, I am
rather a Pythonist. But my strong need to have automatic update of stock
prices on GPW in GnuCash forced me to botch up this module.
--
Pozdrawiam,
Michał Fita
Fri Jan 07 02:50:09 2011 michal.fita [...] gmail.com - Correspondence added [Reply] [Forward]
Subject: Re: [rt.cpan.org #64474] AutoReply: New module suggestion
Date: Fri, 7 Jan 2011 08:49:59 +0100
To: bug-Finance-Quote [...] rt.cpan.org
From: Michał Fita
I would like to update the module to correct version as previous one I
sent was my intermediate version not working one.
Index: finance-quote/MANIFEST
===================================================================
--- finance-quote.orig/MANIFEST
+++ finance-quote/MANIFEST
@@ -47,6 +47,7 @@ lib/Finance/Quote/NZX.pm
lib/Finance/Quote/Platinum.pm
lib/Finance/Quote/SEB.pm
lib/Finance/Quote/StockHouseCanada.pm
+lib/Finance/Quote/Stooq.pm
lib/Finance/Quote/Tdefunds.pm
lib/Finance/Quote/Tdwaterhouse.pm
lib/Finance/Quote/Tiaacref.pm
Index: finance-quote/lib/Finance/Quote/Stooq.pm
===================================================================
--- /dev/null
+++ finance-quote/lib/Finance/Quote/Stooq.pm
@@ -0,0 +1,149 @@
+# Copyright (C) 1998, Dj Padzensky
+# Copyright (C) 1998, 1999 Linas Vepstas
+# Copyright (C) 2000, Yannick LE NY
+# Copyright (C) 2000, Paul Fenwick
+# Copyright (C) 2000, Brent Neal
+# Copyright (C) 2000, Keith Refson
+# Copyright (C) 2003, Tomas Carlsson
+# Copytight (C) 2010, Michal Fita
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA
+#
+#
+# This code was derived from the work on the packages Finance::Yahoo::*
+# This code was derived from the work on the packages Finance::SEB
+#
+package Finance::Quote::Stooq;
+require 5.004;
+
+use strict;
+
+use vars qw($VERSION $STOOQ_STOCKS_URL);
+
+use LWP::UserAgent;
+use HTTP::Request::Common;
+use utf8;
+
+$VERSION = '0.10';
+$STOOQ_STOCKS_URL = 'http://stooq.com/q/l/';
+
+sub methods { return (stooq_stocks => \&stooq_stocks); }
+
+{
+ my @labels = qw/date isodate time method source name currency last open high low/;
+
+ sub labels { return (stooq_stocks => \@labels); }
+}
+
+sub stooq_stocks {
+ my $quoter = shift;
+ my @symbols = @_;
+
+ return unless @symbols;
+ my ($ua, $reply, $url, %stocks);
+
+ $ua = $quoter->user_agent;
+ foreach my $symbol (@symbols) {
+ # Nioch, nioch... stooq accepts only lower case tickers!
+ $url = $STOOQ_STOCKS_URL . '?s=' . lc $symbol;
+ $reply = $ua->request(GET $url);
+ unless ($reply->is_success) {
+ $stocks{$symbol, "success"} = 0;
+ $stocks{$symbol, "errormsg"} = "HTTP failure";
+ return wantarray ? %stocks : \%stocks;
+ }
+
+ my ($line) = split(/\n/, $reply->content, 1);
+ chomp($line);
+ # Format:
+ # Trade Date, Name, Trade Time,Open, Max,Min,Price,Volume,Unknown
+ # 20101229,"TAURONPE","142635",6.77,6.77,6.69,6.71,578233,0
+ my ($date, $name, $time, $open, $high, $low, $last, $volume, $hmm) = split ',', $line;
+ utf8::encode($name);
+ #if (grep {$_ eq $name} @symbols) {
+ unless ($date eq "N/A") {
+ #$price =~ s/,/\./; # change decimal point from , to .
+ $stocks{$symbol, 'symbol'} = $symbol;
+ my ($year, $month, $day) = ($date =~ /(\d{4})(\d{2})(\d{2})/);
+ $quoter->store_date(\%stocks, $name, {year => $year, month => $month, day => $day});
+ $stocks{$symbol, 'time'} = ($_ = $time, s/(\d{2})(\d{2})(\d{2})/$1:$2:$3/, $_);
+ $stocks{$symbol, 'method'} = 'stooq_stocks';
+ $stocks{$symbol, 'source'} = 'Finance::Quote::GPW';
+ $stocks{$symbol, 'name'} = ($_ = $name, s/[\"]//g, $_);
+ $stocks{$symbol, 'currency'} = 'PLN';
+ $stocks{$symbol, 'last'} = $last;
+ $stocks{$symbol, 'price'} = $last;
+ $stocks{$symbol, 'open'} = $open;
+ $stocks{$symbol, 'high'} = $high;
+ $stocks{$symbol, 'low'} = $low;
+ $stocks{$symbol, 'success'} = 1;
+ }
+ }
+
+ # Check for undefined symbols
+ foreach my $symbol (@symbols) {
+ unless ($stocks{$symbol, 'success'}) {
+ $stocks{$symbol, "success"} = 0;
+ $stocks{$symbol, "errormsg"} = "Stock name not found";
+ }
+ }
+
+ return %stocks if wantarray;
+ return \%stocks;
+}
+
+1;
+
+=head1 NAME
+
+Finance::Quote::Stooq - Obtain prices of stocks traded on GPW from www.stooq.com
+
+=head1 SYNOPSIS
+
+ use Finance::Quote;
+
+ $q = Finance::Quote->new;
+
+ %stockinfo = $q->fetch("stooq_stocks","tlt"); # the letter ticker
+
+=head1 DESCRIPTION
+
+This module obtains information about prices of stocks being trade on WARSAW
+STOCK EXCHANGE market in Poland through popular stooq.com service, as currently
+open method for accessing such data directly from GPW is not known.
+
+=head1 STOCK NAMES
+
+Every stock shares traded on Warsaw Stock Exchange has its own unique three
+letter ticker.
+
+For example:
+"GPW" for Warsaw Stock Exchange itself,
+"TPE" for Tauron Polska Energia,
+"PZU" for Polski Zak�ad Ubezpiecze� (most valuable equity is stocks on GPW).
+
+=head1 LABELS RETURNED
+
+Information available from GPW may include the following labels:
+date time method source name currency price low high. The prices are available for most
+recect closed session.
+
+=head1 SEE ALSO
+
+GPW website - http://www.gpw.pl/
+STOOQ website - http://www.stooq.com/
+
+=cut
++++++ perl-Finance-Quote-64897-0001-adopted-to-site-changes.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=64897
This is a merge of the patch provided by the bug tracker to the upstream
GIT snapshot.
Date: Tue Jan 18 15:29:56 2011 stephan.ebelt [...] gmx.net - Ticket created
Subject: GoldMoney site has changed (patch attached)
the goldmoney site has been updated recently and they now allow to
purchase palladium as well. attached are two patches for the
GoldMoney.pm module and its test.
From da395b7bf039ce13e50e0da8a6c3dbd84427aa2e Mon Sep 17 00:00:00 2001
From: Stephan Ebelt
Date: Tue, 18 Jan 2011 20:33:09 +0100
Subject: [PATCH] adopted to site changes
they dropped pretty much all tables, therefore we use HTML::TreeBuilder now
---
lib/Finance/Quote/GoldMoney.pm | 102 ++++++++++++++++++---------------------
1 files changed, 47 insertions(+), 55 deletions(-)
Index: finance-quote/lib/Finance/Quote/GoldMoney.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/GoldMoney.pm
+++ finance-quote/lib/Finance/Quote/GoldMoney.pm
@@ -32,6 +32,7 @@ require Crypt::SSLeay;
use HTTP::Request::Common;
use HTML::TableExtract;
+use HTML::TreeBuilder;
use strict;
use warnings;
@@ -58,11 +59,12 @@ sub goldmoney {
my @symbols = @_;
return unless @symbols;
+ my $GOLDMONEY_URL = "http://goldmoney.com";
+
my $ua = $quoter->user_agent;
my (%symbolhash, @q, %info);
my (
- $html_string, $te, $table_gold, $table_silver, $table_platinum,
- $gold_gg, $gold_oz, $silver_oz, $platinum_oz, $platinum_pg, $currency
+ $html_string, $tree, $gold_gg, $gold_oz, $silver_oz, $platinum_oz, $platinum_pg, $currency
);
my $_want_gold = 0;
@@ -92,18 +94,14 @@ sub goldmoney {
# get the page
# - but only if we want either gold, silver or platinum (there is nothing else there)
if( $_want_gold or $_want_silver or $_want_platinum) {
- my $GOLDMONEY_URL = "http://goldmoney.com";
my $response = $ua->request(GET $GOLDMONEY_URL);
if ($response->is_success) {
$html_string =$response->content;
- # we want the 'Current Spot Rates' table
- $te = new HTML::TableExtract->new( attribs=>{class=>'spot'}, subtables=>1);
- $te->parse($html_string);
- $table_gold=$te->table(3,0);
- $table_silver=$te->table(3,1);
- $table_platinum=$te->table(3,2);
+ # setup the HTML tag tree
+ $tree = new HTML::TreeBuilder->new();
+ $tree->parse($html_string);
} else {
# retrieval error - flag an error and return right away
foreach my $s (@symbols) {
@@ -125,70 +123,64 @@ sub goldmoney {
# get gold rate
#
if( $_want_gold ) {
- $_ = $table_gold->cell(0,0);
- if( /(\d*\.\d*).*\/gg/ ) {
- $gold_gg = $1;
- }
+ $_ = $tree->look_down("_tag", "span", "id", "spot-price-gold-oz");
- $_ = $table_gold->cell(0,0);
- if( /(\d*\.\d*).*\/oz/ ) {
+ if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
$gold_oz = $1;
-
- # assemble final dataset
- # - take "now" as date/time as the site is always current and does
- # not provide this explicitly - so there is a time-slip
- $quoter->store_date(\%info, 'gold', {isodate => _goldmoney_time('isodate')});
- $info{'gold','time'} = _goldmoney_time('time');
- $info{'gold','name'} = 'Gold Spot';
- $info{'gold','last'} = $gold_oz;
- $info{'gold','price'} = $gold_oz;
- $info{'gold','price_gg'} = $gold_gg;
- $info{'gold','currency'} = $currency;
- $info{'gold','success'} = 1;
}
+
+ # assemble final dataset
+ # - take "now" as date/time as the site is always current and does
+ # not provide this explicitly - so there is a time-slip
+ $quoter->store_date(\%info, 'gold', {isodate => _goldmoney_time('isodate')});
+ $info{'gold','time'} = _goldmoney_time('time');
+ $info{'gold','name'} = 'Gold Spot';
+ $info{'gold','last'} = $gold_oz;
+ $info{'gold','price'} = $gold_oz;
+ $info{'gold','currency'} = $currency;
+ $info{'gold','success'} = 1;
}
# get silver rate
#
if( $_want_silver ) {
- $_ = $table_silver->cell(0,0);
- if( /(\d*\.\d*).*\/oz/ ) {
- $silver_oz = $1;
+ $_ = $tree->look_down("_tag", "span", "id", "spot-price-silver-oz");
- $quoter->store_date(\%info, 'silver', {isodate => _goldmoney_time('isodate')});
- $info{'silver','time'} = _goldmoney_time('time');
- $info{'silver','name'} = 'Silver Spot';
- $info{'silver','last'} = $silver_oz;
- $info{'silver','price'} = $silver_oz;
- $info{'silver','currency'} = $currency;
- $info{'silver','success'} = 1;
+ if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
+ $silver_oz = $1;
}
+
+ # assemble final dataset
+ # - take "now" as date/time as the site is always current and does
+ # not provide this explicitly - so there is a time-slip
+ $quoter->store_date(\%info, 'silver', {isodate => _goldmoney_time('isodate')});
+ $info{'silver','time'} = _goldmoney_time('time');
+ $info{'silver','name'} = 'Silver Spot';
+ $info{'silver','last'} = $silver_oz;
+ $info{'silver','price'} = $silver_oz;
+ $info{'silver','currency'} = $currency;
+ $info{'silver','success'} = 1;
}
# get platinum rate
#
if( $_want_platinum ) {
- $_ = $table_platinum->cell(0,0);
- if( /(\d*\.\d*).*\/pg/ ) {
- $platinum_pg = $1;
- }
+ $_ = $tree->look_down("_tag", "span", "id", "spot-price-platinum-oz");
- $_ = $table_platinum->cell(0,0);
- if( /(\d*\.\d*).*\/oz/ ) {
+ if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
$platinum_oz = $1;
-
- # assemble final dataset
- # - take "now" as date/time as the site is always current and does
- # not provide this explicitly - so there is a time-slip
- $quoter->store_date(\%info, 'platinum', {isodate => _goldmoney_time('isodate')});
- $info{'platinum','time'} = _goldmoney_time('time');
- $info{'platinum','name'} = 'Platinum Spot';
- $info{'platinum','last'} = $platinum_oz;
- $info{'platinum','price'} = $platinum_oz;
- $info{'platinum','price_pg'} = $platinum_pg;
- $info{'platinum','currency'} = $currency;
- $info{'platinum','success'} = 1;
}
+
+ # assemble final dataset
+ # - take "now" as date/time as the site is always current and does
+ # not provide this explicitly - so there is a time-slip
+ $quoter->store_date(\%info, 'platinum', {isodate => _goldmoney_time('isodate')});
+ $info{'platinum','time'} = _goldmoney_time('time');
+ $info{'platinum','name'} = 'Platinum Spot';
+ $info{'platinum','last'} = $platinum_oz;
+ $info{'platinum','price'} = $platinum_oz;
+ $info{'platinum','currency'} = $currency;
+ $info{'platinum','success'} = 1;
}
}
++++++ perl-Finance-Quote-64897-0002-support-palladium-lookup.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=64897
This is a merge of the patch provided by the bug tracker to the upstream
GIT snapshot.
Date: Tue Jan 18 15:29:56 2011 stephan.ebelt [...] gmx.net - Ticket created
Subject: GoldMoney site has changed (patch attached)
the goldmoney site has been updated recently and they now allow to
purchase palladium as well. attached are two patches for the
GoldMoney.pm module and its test.
From e410b33151f394d76219a0f0de24de232f4e8750 Mon Sep 17 00:00:00 2001
From: Stephan Ebelt
Date: Tue, 18 Jan 2011 20:47:11 +0100
Subject: [PATCH] support 'palladium' lookup
---
lib/Finance/Quote/GoldMoney.pm | 46 +++++++++++++++++++++++++++++++--------
t/goldmoney.t | 13 +++++++++-
2 files changed, 47 insertions(+), 12 deletions(-)
Index: finance-quote/lib/Finance/Quote/GoldMoney.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/GoldMoney.pm
+++ finance-quote/lib/Finance/Quote/GoldMoney.pm
@@ -7,7 +7,7 @@
# Copyright (C) 2000, Brent Neal
# Copyright (C) 2000, Volker Stuerzl
# Copyright (C) 2006, Klaus Dahlke
-# Copyright (C) 2008, Stephan Ebelt
+# Copyright (C) 2011, Stephan Ebelt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -31,7 +31,6 @@ require 5.005;
require Crypt::SSLeay;
use HTTP::Request::Common;
-use HTML::TableExtract;
use HTML::TreeBuilder;
use strict;
@@ -51,7 +50,8 @@ sub labels {
# goldmoney($quoter, @symbols)
#
-# - get 'gold' and 'silver' spot rates from goldmoney.com
+# - get 'gold', 'silver', 'platinum' and 'palladium' spot rates from
+# goldmoney.com
# - error out properly (that is: ignore) all other symbols
#
sub goldmoney {
@@ -64,12 +64,14 @@ sub goldmoney {
my $ua = $quoter->user_agent;
my (%symbolhash, @q, %info);
my (
- $html_string, $tree, $gold_gg, $gold_oz, $silver_oz, $platinum_oz, $platinum_pg, $currency
+ $html_string, $tree, $gold_oz, $silver_oz, $platinum_oz,
+ $palladium_oz, $currency
);
my $_want_gold = 0;
my $_want_silver = 0;
my $_want_platinum = 0;
+ my $_want_palladium = 0;
# - feed all requested symbols into %info (to be returned later)
# - set error state to false by default
@@ -86,8 +88,10 @@ sub goldmoney {
$_want_silver = 1;
} elsif($s eq 'platinum') {
$_want_platinum = 1;
+ } elsif($s eq 'palladium') {
+ $_want_palladium = 1;
} else {
- $info{$s,'errormsg'} = "No data returned (note: this module only works for 'gold' and 'silver')";
+ $info{$s,'errormsg'} = "No data returned (note: this module only works for 'gold', 'silver', 'platinum' and 'palladium')";
}
}
@@ -182,6 +186,28 @@ sub goldmoney {
$info{'platinum','currency'} = $currency;
$info{'platinum','success'} = 1;
}
+
+ # get palladium rate
+ #
+ if( $_want_palladium ) {
+ $_ = $tree->look_down("_tag", "span", "id", "spot-price-palladium-oz");
+
+ if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
+ $palladium_oz = $1;
+ $palladium_oz =~ s/,//g;
+ }
+
+ # assemble final dataset
+ # - take "now" as date/time as the site is always current and does
+ # not provide this explicitly - so there is a time-slip
+ $quoter->store_date(\%info, 'palladium', {isodate => _goldmoney_time('isodate')});
+ $info{'palladium','time'} = _goldmoney_time('time');
+ $info{'palladium','name'} = 'Palladium Spot';
+ $info{'palladium','last'} = $palladium_oz;
+ $info{'palladium','price'} = $palladium_oz;
+ $info{'palladium','currency'} = $currency;
+ $info{'palladium','success'} = 1;
+ }
}
return wantarray() ? %info : \%info;
@@ -229,12 +255,12 @@ Finance::Quote::GoldMoney - obtain spot
$q = Finance::Quote->new;
- %rates = $q->fetch('goldmoeny','gold', 'silver', 'platinum');
+ %rates = $q->fetch('goldmoney','gold', 'silver', 'platinum', 'palladium');
=head1 DESCRIPTION
-This module obtains current spot rates for 'gold', 'silver' and
-'platinum' from Goldmoney (http://www.goldmoney.com). All other
+This module obtains current spot rates for 'gold', 'silver', 'platinum'
+and 'palladium' from GoldMoney (http://goldmoney.com). All other
symbols are ignored.
Information returned by this module is governed by Net Transactions
@@ -248,8 +274,8 @@ The following labels are returned by Fin
- exchange
- name
- date, time
- - price (per ounce), price_gg (per goldgram, gold only),
- price_pg (per platinumgram, platinum only)
+ - price (per ounce)
+ - last (per ounce, same as 'price')
- currency
=head1 SEE ALSO
Index: finance-quote/t/goldmoney.t
===================================================================
--- finance-quote.orig/t/goldmoney.t
+++ finance-quote/t/goldmoney.t
@@ -7,12 +7,12 @@ if (not $ENV{ONLINE_TEST}) {
plan skip_all => 'Set $ENV{ONLINE_TEST} to run this test';
}
-plan tests => 23;
+plan tests => 31;
# Test GoldMoney functions.
my $q = Finance::Quote->new("GoldMoney");
$q->set_currency('EUR');
-my %quotes = $q->fetch("goldmoney","gold", "silver", "platinum", "BOGUS");
+my %quotes = $q->fetch("goldmoney","gold", "silver", "platinum", "palladium", "BOGUS");
ok(%quotes);
# Check that sound information is returned for gold, silver and platinum.
@@ -34,6 +34,13 @@ ok($quotes{"platinum","currency"} eq "EU
ok(length($quotes{"platinum","date"}) > 0);
ok(length($quotes{"platinum","time"}) > 0);
+ok($quotes{"palladium","success"}, 'palladium price lookup');
+ok($quotes{"palladium","last"} > 0);
+ok( $quotes{"palladium","last"} !~ /^0/ );
+ok($quotes{"palladium","currency"} eq "EUR");
+ok(length($quotes{"palladium","date"}) > 0);
+ok(length($quotes{"palladium","time"}) > 0);
+
my $year = (localtime())[5] + 1900;
ok((substr($quotes{"gold","isodate"},0,4) == $year));
ok((substr($quotes{"gold","date"},6,4) == $year));
@@ -41,6 +48,8 @@ ok((substr($quotes{"silver","isodate"},0
ok((substr($quotes{"silver","date"},6,4) == $year));
ok((substr($quotes{"platinum","isodate"},0,4) == $year));
ok((substr($quotes{"platinum","date"},6,4) == $year));
+ok((substr($quotes{"palladium","isodate"},0,4) == $year));
+ok((substr($quotes{"palladium","date"},6,4) == $year));
# Check that a bogus symbol returns no-success.
ok(! $quotes{"BOGUS","success"});
++++++ perl-Finance-Quote-65269-ftfunds.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=65269
Subject: New module for UK unit trusts - ftfunds
Date: Mon, 31 Jan 2011 01:19:16 +0000
To: bug-Finance-Quote [...] rt.cpan.org
From: Martin Sadler
Please find attached a new module I've developed to retrieve quotes for
UK unit trusts, etc. from the Financial Times web-site
http://funds.ft.com/.
This module uses the MEXID to retrieve data on over 47,000 funds quoted
on this site.
This is my first attempt at perl programming so I'd appreciate any
feedback on any errors or improvements in my code.
BTW - my e-mail address on sourceforge.net is
martinsadler@users.sourceforge.net. I'd appreciate the use of this
e-mail address in any publicly-accessible files posted on CPAN or
sourceforge.net.
Best regards,
Index: finance-quote/MANIFEST
===================================================================
--- finance-quote.orig/MANIFEST
+++ finance-quote/MANIFEST
@@ -33,6 +33,7 @@ lib/Finance/Quote/Fidelity.pm
lib/Finance/Quote/FinanceCanada.pm
lib/Finance/Quote/Finanzpartner.pm
lib/Finance/Quote/Fool.pm
+lib/Finance/Quote/FTFunds.pm
lib/Finance/Quote/FTPortfolios.pm
lib/Finance/Quote/GoldMoney.pm
lib/Finance/Quote/HEX.pm
Index: finance-quote/lib/Finance/Quote/FTFunds.pm
===================================================================
--- /dev/null
+++ finance-quote/lib/Finance/Quote/FTFunds.pm
@@ -0,0 +1,345 @@
+#!/usr/bin/perl -w
+
+# ftfunds.pm
+#
+# Obtains quotes for UK Unit Trusts from http://funds.ft.com/ - please
+# refer to the end of this file for further information.
+#
+# author: Martin Sadler (martinsadler@users.sourceforge.net)
+#
+# Version 0.1 Initial version - 06 Sep 2010
+#
+# Version 0.2 Better look-up - 19 Sep 2010
+#
+# Version 0.3 name changed to "ftfunds" (all lower case) and tidy-up - 31 Jan 2011
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA
+#
+
+
+package Finance::Quote::ftfunds;
+require 5.005;
+
+use strict;
+use warnings;
+
+# URLs
+use vars qw($VERSION $FTFUNDS_LOOK_UP $FTFUNDS_MAIN_URL);
+
+use LWP::UserAgent;
+use HTTP::Request::Common;
+
+$VERSION = '1.17';
+
+$FTFUNDS_MAIN_URL = "http://funds.ft.com";
+$FTFUNDS_LOOK_UP = "http://funds.ft.com/ListedFundFactsheet.aspx?mid=";
+
+ # this will work with MEXID codes only ("mid" = "MEXID").
+
+# FIXME - Add code to use ISIN or SEDOL in addition to MEXID - javascript cookies??!!
+
+sub methods { return (ftfunds => \&ftfunds_fund,
+ ukfunds => \&ftfunds_fund); }
+
+{
+ my @labels = qw/name currency last date time price nav source iso_date method net p_change success errormsg/;
+
+ sub labels { return (ftfunds => \@labels,
+ ukfunds => \@labels); }
+}
+
+#
+# =======================================================================
+
+sub ftfunds_fund {
+ my $quoter = shift;
+ my @symbols = @_;
+
+ return unless @symbols;
+
+ my %fundquote;
+
+ my $ua = $quoter->user_agent;
+
+ foreach (@symbols)
+ {
+ my $code = $_;
+
+ my $code_type = "** Invalid **";
+ if ($code =~ m/^[a-zA-Z]{2}[a-zA-Z0-9]{9}\d(.*)/ && !$1) { $code_type = "ISIN"; }
+ elsif ($code =~ m/^[a-zA-Z0-9]{6}\d(.*)/ && !$1 ) { $code_type = "SEDOL"; }
+ elsif ($code =~ m/^[a-zA-Z]{4,6}(.*)/ && !$1) { $code_type = "MEXID"; }
+
+# current version can only use MEXID - report an error and exit if any other type
+
+ if ($code_type ne "MEXID")
+ {
+ $fundquote {$code,"success"} = 0;
+ $fundquote {$code,"errormsg"} = "Error - invalid symbol";
+ next;
+ }
+
+ $fundquote {$code,"success"} = 1; # ever the optimist....
+ $fundquote {$code,"errormsg"} = "Success";
+
+# perform the look-up - if not found, return with error
+
+ my $webdoc = $ua->get($FTFUNDS_LOOK_UP.$code);
+ if (!$webdoc->is_success)
+ {
+ # serious error, report it and give up
+ $fundquote {$code,"success"} = 0;
+ $fundquote {$code,"errormsg"} =
+ "Error - failed to retrieve fund data : HTTP status = ".$webdoc->status_line;
+ next;
+ }
+ $fundquote {$code, "symbol"} = $code;
+ $fundquote {$code, "source"} = $FTFUNDS_MAIN_URL;
+
+# Find name by simple regexp
+
+ my $name;
+ if ($webdoc->content =~
+ m[<span id="ctl00_ContentWell_lblFundName" class="FundNameHeader">(.*)</span>] )
+ {
+ $name = $1 ;
+ }
+ if (!defined($name)) {
+ # not a serious error - don't report it ....
+# $fundquote {$code,"success"} = 0;
+ # ... but set a useful message ....
+ $fundquote {$code,"errormsg"} = "Warning - failed to find fund name";
+ $name = "*** UNKNOWN ***";
+ # ... and continue
+ }
+ $fundquote {$code, "name"} = $name; # set name
+
+# Find currency
+
+ my $currency;
+ if ($webdoc->content =~
+ m[<span id="ctl00_ContentWell_ListPriceInformation_lbllatestPriceCurrency" class="greyText">(...)</span>] )
+ {
+ $currency = $1;
+ }
+ if (!defined($currency)) {
+ # serious error, report it and give up
+ $fundquote {$code,"success"} = 0;
+ $fundquote {$code,"errormsg"} = "Error - failed to find a currency";
+ next;
+ }
+
+ # defer setting currency until we've retrieved price and net...
+
+# Find latest price
+
+ my $price;
+ if ($webdoc->content =~
+ m[<span id="ctl00_ContentWell_ListPriceInformation_lblLatestPrice">(.*)</span>] )
+ {
+ $price = $1 ;
+ }
+ if (!defined($price)) {
+ # serious error, report it and give up
+ $fundquote {$code,"success"} = 0;
+ $fundquote {$code,"errormsg"} = "Error - failed to find a price";
+ next;
+ }
+
+ # defer setting price until we've retrieved net...
+
+# Find net change
+
+ my $net;
+ if ($webdoc->content =~
+ m[<span id="ctl00_ContentWell_ListPriceInformation_lblLastTradeChange" class="(|posi|nega|)tiveDecimal">(.*)</span>] )
+ {
+ $net = $2 ; # allow for alternates in match string
+ }
+ if (!defined($net)) {
+ # not a serious error - don't report it ....
+# $fundquote {$code,"success"} = 0;
+ # ... but set a useful message ....
+ $fundquote {$code,"errormsg"} = "Warning - failed to find a net change.";
+ $net = "-0.00"; # ???? is this OK ????
+ # ... and continue
+ }
+
+ # defer setting net until we've checked for GBX currency
+
+# deal with GBX pricing of UK unit trusts
+
+ if ($currency eq "GBX")
+ {
+ $currency = "GBP" ;
+ $price = $price / 100 ;
+ $net = $net / 100 ;
+ }
+
+ # now set prices, net change and currency
+
+ $fundquote {$code, "price"} = $price;
+ $fundquote {$code, "last"} = $price;
+ $fundquote {$code, "nav"} = $price;
+ $fundquote {$code, "net"} = $net;
+ $fundquote {$code, "currency"} = $currency;
+
+# Find %-change
+
+ my $pchange;
+ if ($webdoc->content =~
+ m[<span id="ctl00_ContentWell_ListPriceInformation_lblLastTradePercentageChange" class="(|posi|nega|)tiveDecimal">(.*)%</span>] )
+ {
+ $pchange = $2 ; # allow for alternates in match string
+ }
+ if (!defined($pchange)) {
+ # not a serious error - don't report it ....
+# $fundquote {$code,"success"} = 0;
+ # ... but set a useful message ....
+ $fundquote {$code,"errormsg"} = "Warning - failed to find a %-change";
+ $pchange = "-0.00"; # ???? is this OK ????
+ # ... and continue
+ }
+
+ $fundquote {$code, "p_change"} = $pchange; # set %-change
+
+# Find time
+
+ my $time;
+ if ($webdoc->content =~ m[<span id="ctl00_ContentWell_TabContainer1_tabSummary_lblSummaryTabFundManagementPricingTimeValue">(.*)</span>] )
+ {
+ if ($1 =~ m[(\d\d:\d\d)] ) # strip any trailing text (Timezone, etc.)
+ {
+ $time = $1;
+ }
+ }
+ if (!defined($time)) {
+ # not a serious error - don't report it ....
+# $fundquote {$code,"success"} = 0;
+ # ... but set a useful message ....
+ $fundquote {$code,"errormsg"} = "Warning - failed to find a time";
+ $time = "12:00"; # set to Midday if no time supplied ???
+ # gnucash insists on having a valid-format
+ # ... and continue
+ }
+
+ $fundquote {$code, "time"} = $time; # set time
+
+# Find date
+
+ my $date;
+ my $date_string='';
+ if ($webdoc->content =~
+ m[<span id="ctl00_ContentWell_ListPriceInformation_lblLatestPriceDate">(.*)</span>] )
+ {
+ $date = $1 ;
+ }
+ if (!defined($date)) {
+ # not a serious error - don't report it ....
+# $fundquote {$code,"success"} = 0;
+ # ... but set a useful message ....
+ $fundquote {$code,"errormsg"} = "Warning - failed to find a date";
+ # use today's date
+ $quoter->store_date(\%fundquote, $code, {today => 1});
+ # ... and continue
+ }
+ else
+ {
+ $quoter->store_date(\%fundquote, $code, {eurodate => $date});
+ }
+
+ $fundquote {$code, "method"} = "ftfunds"; # set method
+
+ }
+
+ return wantarray ? %fundquote : \%fundquote;
+}
+
+1;
+
+=head1 NAME
+
+Finance::Quote::ftfunds - Obtain UK Unit Trust quotes from FT.com (Financial Times).
+
+=head1 SYNOPSIS
+
+ $q = Finance::Quote->new;
+
+ %info = Finance::Quote->fetch("ftfunds","<mexid> ..."); # Only query FT.com using MEXIDs
+ %info = Finance::Quote->fetch("ukfunds","<isin>|<sedol>|<mexid>..."); # Failover to other sources
+
+=head1 DESCRIPTION
+
+This module fetches information from the Financial Times Funds service,
+http://funds.ft.com. There are over 47,000 UK Unit Trusts and OEICs quoted,
+as well as many Offshore Funds and Exhange Traded Funds (ETFs). It converts
+any funds quoted in GBX (pence) to GBP, dividing the price by 100 in the
+process.
+
+Funds are identified by their MEXID code, a 4-6 letter code. Although the
+web site also allows searching by SEDOL or ISIN codes, this version of
+Finance::Quote::ftfunds only implements MEXID lookup. To determine the MEXID
+for funds of interest to you, visit the funds.ft.com site and use the flexible
+search facilities to identify the funds of interest. The factsheet display for
+any given fund displays the MEXID, SEDOL and ISIN along with other useful information.
+
+This module is loaded by default on a Finance::Quote object. It's
+also possible to load it explicity by placing "ftfunds" in the argument
+list to Finance::Quote->new().
+
+Information obtained by this module may be covered by funds.ft.com
+terms and conditions See http://funds.ft.com/ and http://ft.com for details.
+
+=head2 Stocks And Indices
+
+This module provides both the "ftfunds" and "ukfunds" fetch methods for
+fetching UK and Offshore Unit Trusts and OEICs prices and other information
+from funds.ft.com. Please use the "ukfunds" fetch method if you wish to have
+failover with future sources for UK and Offshore Unit Trusts and OEICs - the
+author has plans to develop Finance::Quote modules for the London Stock Exchange
+and Morningstar unit trust services. Using the "ftfunds" method will guarantee
+that your information only comes from the funds.ft.com website.
+
+=head1 LABELS RETURNED
+
+The following labels may be returned by Finance::Quote::ftfunds :
+
+ name, currency, last, date, time, price, nav, source, method,
+ iso_date, net, p_change, success, errormsg.
+
+
+=head1 SEE ALSO
+
+Financial Times websites, http://ft.com and http://funds.ft.com
+
+
+=head1 AUTHOR
+
+Martin Sadler, E<lt>martinsadler@users.sourceforge.netE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2010 by Martin Sadler
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself, either Perl version 5.10.1 or,
+at your option, any later version of Perl 5 you may have available.
+
+
+=cut
+
+__END__
+
++++++ perl-Finance-Quote-66235-Cdnfundlibrary-row.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=66235
Subject: Cdnfundlibrary isn't retrieving the newest available NAV
Date: Mon Feb 28 01:39:08 2011 nul [...] ereomega.net - Ticket created
The row of the table Cdnfundlibrary retrieves is the second to most
recent (top) row. The following current code should be changed
so that the newest available NAV is retrieved.
Index: finance-quote/lib/Finance/Quote/Cdnfundlibrary.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/Cdnfundlibrary.pm
+++ finance-quote/lib/Finance/Quote/Cdnfundlibrary.pm
@@ -92,7 +92,7 @@ sub fundlibrary {
$fundquote {$mutual, "method"} = "fundlibrary";
# Fund price and date
- $row = $rows[1];
+ $row = $rows[0];
$fundquote {$mutual, "price"} = $$row[2];
$fundquote {$mutual, "nav"} = $$row[2];
$fundquote {$mutual, "last"} = $$row[2];
++++++ perl-Finance-Quote-70690-IndiaMutual-temp-del.patch ++++++
Index: finance-quote/lib/Finance/Quote/IndiaMutual.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/IndiaMutual.pm
+++ finance-quote/lib/Finance/Quote/IndiaMutual.pm
@@ -67,6 +67,7 @@ sub amfiindia {
open NAV, $AMFI_NAV_LIST or die "Unexpected error in opening file: $!\n";
+ unlink ($AMFI_NAV_LIST);
# Scheme Code;Scheme Name;Net Asset Value;Repurchase Price;Sale Price;Date
while (<NAV>) {
++++++ perl-Finance-Quote-70690-IndiaMutual-temp.patch ++++++
https://rt.cpan.org/Public/Bug/Display.html?id=70690
Subject: Finance::Quote::IndiaMutual temp file creation
Date: Fri, 2 Sep 2011 00:13:44 +0100
To: bug-Finance-Quote [...] rt.cpan.org
From: Vishal Grover
Hi,
Finance::Quote::IndiaMutual uses a hardcoded temporary file for downloaded
NAVs. This approach fails with ActivePerl on Windows. A simple patch is
below
Thanks
Vishal
Index: finance-quote/lib/Finance/Quote/IndiaMutual.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/IndiaMutual.pm
+++ finance-quote/lib/Finance/Quote/IndiaMutual.pm
@@ -13,6 +13,7 @@ use LWP::UserAgent;
use HTTP::Request::Common;
use HTTP::Status;
use HTML::TableExtract;
+use File::Temp qw / tempfile /;
$VERSION = '1.17';
@@ -22,7 +23,7 @@ $VERSION = '1.17';
$AMFI_MAIN_URL = ("http://amfiindia.com/");
$AMFI_URL = ("${AMFI_MAIN_URL}NavReport.aspx?type=0");
#$AMFI_URL = ("${AMFI_MAIN_URL}spages/NAV0.txt"); This page seems to do the job also. Keep for reference
-$AMFI_NAV_LIST = "/tmp/amfinavlist.txt";
+(undef, $AMFI_NAV_LIST) = tempfile();
sub methods { return (indiamutual => \&amfiindia,
amfiindia => \&amfiindia); }
++++++ perl-Finance-Quote-debian-02_typo.patch ++++++
Bug 409358, reported by Andrew Schulman .
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote.pm 2007-01-08 00:53:49.000000000 +0100
+++ ./lib/Finance/Quote.pm 2007-04-14 18:42:35.000000000 +0200
@@ -694,7 +694,7 @@
This module gets stock quotes from various internet sources, including
Yahoo! Finance, Fidelity Investments, and the Australian Stock Exchange.
There are two methods of using this module -- a functional interface
-that is depreciated, and an object-orientated method that provides
+that is deprecated, and an object-orientated method that provides
greater flexibility and stability.
With the exception of straight currency exchange rates, all information
++++++ perl-Finance-Quote-debian-03_whatis.patch ++++++
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/AEX.pm lib/Finance/Quote/AEX.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/AEX.pm 2005-11-17 07:49:17.000000000 +0100
+++ ./lib/Finance/Quote/AEX.pm 2008-02-03 17:31:39.000000000 +0100
@@ -559,7 +559,7 @@
=head1 NAME
-Finance::Quote::AEX Obtain quotes from Amsterdam Euronext eXchange
+Finance::Quote::AEX - Obtain quotes from Amsterdam Euronext eXchange
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/AIAHK.pm lib/Finance/Quote/AIAHK.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/AIAHK.pm 2006-09-11 16:08:47.000000000 +0200
+++ ./lib/Finance/Quote/AIAHK.pm 2008-02-03 17:31:56.000000000 +0100
@@ -139,7 +139,7 @@
=head1 NAME
-Finance::Quote::AIAHK Obtain quotes from American International Assurance
+Finance::Quote::AIAHK - Obtain quotes from American International Assurance
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/ASEGR.pm lib/Finance/Quote/ASEGR.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/ASEGR.pm 2005-05-05 01:51:11.000000000 +0200
+++ ./lib/Finance/Quote/ASEGR.pm 2008-02-03 17:32:10.000000000 +0100
@@ -111,7 +111,7 @@
=head1 NAME
-Finance::Quote::ASEGR Obtain quotes from Athens Stock Exchange.
+Finance::Quote::ASEGR - Obtain quotes from Athens Stock Exchange.
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/BMONesbittBurns.pm lib/Finance/Quote/BMONesbittBurns.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/BMONesbittBurns.pm 2007-01-08 00:23:20.000000000 +0100
+++ ./lib/Finance/Quote/BMONesbittBurns.pm 2008-02-03 17:32:21.000000000 +0100
@@ -174,7 +174,7 @@
=head1 NAME
-Finance::Quote::BMONesbittBurns Obtain quotes from the BMO NesbittBurns site
+Finance::Quote::BMONesbittBurns - Obtain quotes from the BMO NesbittBurns site
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/Bourso.pm lib/Finance/Quote/Bourso.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/Bourso.pm 2006-12-31 22:21:31.000000000 +0100
+++ ./lib/Finance/Quote/Bourso.pm 2008-02-03 17:32:30.000000000 +0100
@@ -383,7 +383,7 @@
=head1 NAME
-Finance::Quote::Bourso Obtain quotes from Boursorama.
+Finance::Quote::Bourso - Obtain quotes from Boursorama.
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/LeRevenu.pm lib/Finance/Quote/LeRevenu.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/LeRevenu.pm 2006-12-31 21:22:27.000000000 +0100
+++ ./lib/Finance/Quote/LeRevenu.pm 2008-02-03 17:32:40.000000000 +0100
@@ -411,7 +411,7 @@
=head1 NAME
-Finance::Quote::LeRevenu Obtain quotes from http://bourse.lerevenu.com.
+Finance::Quote::LeRevenu - Obtain quotes from http://bourse.lerevenu.com.
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/TSP.pm lib/Finance/Quote/TSP.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/TSP.pm 2007-01-02 02:01:49.000000000 +0100
+++ ./lib/Finance/Quote/TSP.pm 2008-02-03 17:32:52.000000000 +0100
@@ -145,7 +145,7 @@
=head1 NAME
-Finance::Quote::TSP Obtain fund prices for US Federal Government Thrift Savings Plan
+Finance::Quote::TSP - Obtain fund prices for US Federal Government Thrift Savings Plan
=head1 SYNOPSIS
diff -ruN ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/USFedBonds.pm lib/Finance/Quote/USFedBonds.pm
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/USFedBonds.pm 2005-10-22 23:33:17.000000000 +0200
+++ ./lib/Finance/Quote/USFedBonds.pm 2008-02-03 17:33:06.000000000 +0100
@@ -162,9 +162,7 @@
=head1 NAME
-Finance::Quote::USFedBonds
-Get US Federal Bond redemption values directly from the treasury at
-www.publicdebt.treas.gov/sav/savvalue.htm
+Finance::Quote::USFedBonds - Get US Federal Bond redemption values directly from the treasury at www.publicdebt.treas.gov/sav/savvalue.htm
=head1 SYNOPSIS
++++++ perl-Finance-Quote-debian-04_deka.patch ++++++
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/Deka.pm 2007-01-01 00:20:55.000000000 +0100
+++ ./lib/Finance/Quote/Deka.pm 2008-02-03 17:24:07.000000000 +0100
@@ -62,8 +62,7 @@
if (!$response -> is_success()) {
$info{$stock,"errormsg"} = "HTTP failure";
} else {
- my @headers = [qw(Name ISIN Whg Datum)];
- my $te = new HTML::TableExtract(headers => @headers, slice_columns => 0);
+ my $te = new HTML::TableExtract();
$te->parse($response->content);
foreach my $ts ($te->table_states) {
# foreach my $row ($ts->rows) {
@@ -73,16 +72,34 @@
foreach my $row ($ts->rows) {
next if !defined $$row[0] || !defined $$row[1];
- $info{$stock,"name"} = $$row[0];
- $info{$stock,"currency"} = $$row[2];
- $quoter->store_date(\%info, $stock, {eurodate => $$row[6]});
- $info{$stock,"price"} = convert_price(trim($$row[4]));
- $info{$stock,"last"} = $info{$stock,"price"};
- $info{$stock,"success"} = 1;
- $info{$stock,"method"} = "deka";
- $info{$stock,"symbol"} = $stock;
+ next if !defined $$row[2] || !defined $$row[3];
+ $info{$stock,"currency"} = $$row[1] if( $$row[0] =~ /^W.hrung:$/ );
+ $info{$stock,"price"} = convert_price(trim($$row[3])) if( $$row[2] eq "Anteilpreis Aktuell:" );
}
}
+
+ $info{$stock,"name"} = $1
+ if( $response->content =~ /<div class="sfg_txt">[^<>]*<h1>([^<>]+)<\/h1>/s );
+ $info{$stock,"eurodate"} = $1
+ if( $response->content =~ /<div class="box">[^<>]*<h2 class="headline">Aktuelle Fondsdaten vom ([^<>]+)<\/h2>/s );
+ $info{$stock,"last"} = $info{$stock,"price"}
+ if( defined $info{$stock,"price"} );
+
+ $info{$stock,"success"} = 1
+ if( defined $info{$stock,"name"}
+ && defined $info{$stock,"eurodate"}
+ && defined $info{$stock,"price"}
+ && defined $info{$stock,"last"}
+ && defined $info{$stock,"currency"} );
+
+ if( $info{$stock,"success"} == 1 )
+ {
+ $info{$stock,"method"} = "deka";
+ $info{$stock,"symbol"} = $stock;
+ $quoter->store_date(\%info, $stock, {eurodate => $info{$stock,"eurodate"}});
+ delete $info{$stock,"eurodate"};
+ }
+
$info{$stock,"errormsg"} = "Couldn't parse deka website"
if ($info{$stock,"success"} == 0);
}
++++++ perl-Finance-Quote-debian-06_seb.patch ++++++
--- ../orig/libfinance-quote-perl-1.13/lib/Finance/Quote/SEB.pm 2005-03-20 02:44:13.000000000 +0100
+++ ./lib/Finance/Quote/SEB.pm 2008-06-29 17:34:01.000000000 +0200
@@ -119,7 +119,7 @@
Therefore the complete fund name must be given, including spaces, case
is important.
-Consult http://taz.vv.sebank.se/cgi-bin/pts3/pow/Fonder/kurser/kurslista_body.asp
+Consult http://www.seb.se/
for all available funds.
Example "SEB Aktiesparfond"
++++++ perl-Finance-Quote-debian-08_deka.patch ++++++
Patch by Daniel Bayer
Closes: #539052
--- lib/Finance/Quote/Deka.pm.orig 2009-07-29 11:16:07.000000000 +0200
+++ ./lib/Finance/Quote/Deka.pm 2009-07-29 11:18:12.000000000 +0200
@@ -81,7 +81,7 @@
$info{$stock,"name"} = $1
if( $response->content =~ /<div class="sfg_txt">[^<>]*<h1>([^<>]+)<\/h1>/s );
$info{$stock,"eurodate"} = $1
- if( $response->content =~ /<div class="box">[^<>]*<h2 class="headline">Aktuelle Fondsdaten vom ([^<>]+)<\/h2>/s );
+ if( $response->content =~ /<h2 class="headline">Aktuelle Fondsdaten vom ([^<>]+)<\/h2>/s );
$info{$stock,"last"} = $info{$stock,"price"}
if( defined $info{$stock,"price"} );
++++++ perl-Finance-Quote-debian-10_whatis.patch ++++++
--- ../orig/finance-quote/./lib/Finance/Quote/BSERO.pm 2011-09-18 03:49:17.000000000 +0200
+++ ./lib/Finance/Quote/BSERO.pm 2011-09-18 04:15:09.000000000 +0200
@@ -142,7 +142,7 @@
=head1 NAME
-Finance::Quote::BSERO Obtain quotes from Bucharest Stock Exchange.
+Finance::Quote::BSERO - Obtain quotes from Bucharest Stock Exchange.
=head1 SYNOPSIS
++++++ perl-Finance-Quote-fedora-tiaa-cref.patch ++++++
This is a merge of the patch provided by Fedora with changes done by
upstream between 1.17 and git snapshot dated 20110222.
commit 33ec38d4fec4e9032c08f0ee05e0ca746ac1b83b
Author: Bill Nottingham
Date: Wed Jan 12 12:29:39 2011 -0500
- fix TIAA-CREF (#668935, )
Index: finance-quote/lib/Finance/Quote/Tiaacref.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/Tiaacref.pm
+++ finance-quote/lib/Finance/Quote/Tiaacref.pm
@@ -33,7 +33,7 @@ require Crypt::SSLeay;
use strict;
-use vars qw($VERSION $CREF_URL $TIAA_URL
+use vars qw($VERSION $CREF_URL $CREF_URL_INST $TIAA_URL
%tiaacref_ids %tiaacref_locs %tiaacref_vals);
use LWP::UserAgent;
@@ -45,6 +45,7 @@ $VERSION = '1.17';
# URLs of where to obtain information.
# This used to be different for the CREF and TIAA annuities, but this changed.
$CREF_URL = ("http://www.tiaa-cref.org/public/performance/retirement/data/results?");
+$CREF_URL_INST = ("http://www.tiaa-cref.org/public/performance/institutional/data/results?");
#https://www3.tiaa-cref.org/ddata/DownloadData?");
sub methods { return (tiaacref=>\&tiaacref); }
@@ -97,6 +98,82 @@ sub labels { return (tiaacref => [qw/met
# TIAA-CREF Social Choice Equity: TCSCX
# TIAA-CREF Managed Allocation: TIMAX
+# TIAA-CREF Retirement Fund - Bond: TIDRX
+# TIAA-CREF Retirement Fund - Bond Index: TBIRX
+# TIAA-CREF Retirement Fund - Bond Plus: TCBRX
+# TIAA-CREF Retirement Fund - Emerging Markets Equity: TEMSX
+# TIAA-CREF Retirement Fund - Emerging Markets Equity Index: TEQSX
+# TIAA-CREF Retirement Fund - Equity Index: TIQRX
+# TIAA-CREF Retirement Fund - Growth & Income: TRGIX
+# TIAA-CREF Retirement Fund - High-Yield: TIHRX
+# TIAA-CREF Retirement Fund - Inflation-Linked Bond: TIKRX
+# TIAA-CREF Retirement Fund - International Equity: TRERX
+# TIAA-CREF Retirement Fund - International Equity Index: TRIEX
+# TIAA-CREF Retirement Fund - Large-Cap Growth: TILRX
+# TIAA-CREF Retirement Fund - Large-Cap Growth Index: TRIRX
+# TIAA-CREF Retirement Fund - Large-Cap Value: TRLCX
+# TIAA-CREF Retirement Fund - Large-Cap Value Index: TRCVX
+# TIAA-CREF Retirement Fund - Lifecycle 2010: TCLEX
+# TIAA-CREF Retirement Fund - Lifecycle 2015: TCLIX
+# TIAA-CREF Retirement Fund - Lifecycle 2020: TCLTX
+# TIAA-CREF Retirement Fund - Lifecycle 2025: TCLFX
+# TIAA-CREF Retirement Fund - Lifecycle 2030: TCLNX
+# TIAA-CREF Retirement Fund - Lifecycle 2035: TCLRX
+# TIAA-CREF Retirement Fund - Lifecycle 2040: TCLOX
+# TIAA-CREF Retirement Fund - Lifecycle 2045: TTFRX
+# TIAA-CREF Retirement Fund - Lifecycle 2050: TLFRX
+# TIAA-CREF Retirement Fund - Lifecycle Retirement Income: TLIRX
+# TIAA-CREF Retirement Fund - Managed Allocation: TITRX
+# TIAA-CREF Retirement Fund - Mid-Cap Growth: TRGMX
+# TIAA-CREF Retirement Fund - Mid-Cap Value: TRVRX
+# TIAA-CREF Retirement Fund - Money Market: TIEXX
+# TIAA-CREF Retirement Fund - Real Estate Securities: TRRSX
+# TIAA-CREF Retirement Fund - S&P 500 Index: TRSPX
+# TIAA-CREF Retirement Fund - Short-Term Bond: TISRX
+# TIAA-CREF Retirement Fund - Cap Blend Index: TRBIX
+# TIAA-CREF Retirement Fund - Small-Cap Equity: TRSEX
+# TIAA-CREF Retirement Fund - Social Choice Equity: TRSCX
+
+# TIAA-CREF Institutional Fund - Bond: TIBDX 1835
+# TIAA-CREF Institutional Fund - Bond Index: TBIIX 1837
+# TIAA-CREF Institutional Fund - Bond Plus: TIBFX 1827
+# TIAA-CREF Institutional Fund - Emerging Markets Equity: TEMLX 1848
+# TIAA-CREF Institutional Fund - Emerging Markets Equity Index: TEQLX 1849
+# TIAA-CREF Institutional Fund - Enhanced International Equity Index: TFIIX 1822
+# TIAA-CREF Institutional Fund - Enhanced Large-Cap Growth Index: TLIIX 1820
+# TIAA-CREF Institutional Fund - Enhanced Large-Cap Value Index: TEVIX 1821
+# TIAA-CREF Institutional Fund - Equity Index: TIEIX 1833
+# TIAA-CREF Institutional Fund - Growth & Income: TIGRX 1832
+# TIAA-CREF Institutional Fund - High-Yield: TIHYX 1826
+# TIAA-CREF Institutional Fund - Inflation-Linked Bond: TIILX 1605
+# TIAA-CREF Institutional Fund - International Equity: TIIEX 1830
+# TIAA-CREF Institutional Fund - International Equity Index: TCIEX 1615
+# TIAA-CREF Institutional Fund - Large-Cap Growth: TILGX 1824
+# TIAA-CREF Institutional Fund - Large-Cap Growth Index: TILIX 1607
+# TIAA-CREF Institutional Fund - Large-Cap Value: TRLIX 1601
+# TIAA-CREF Institutional Fund - Large-Cap Value Index: TILVX 1608
+# TIAA-CREF Institutional Fund - Lifecycle 2010: TCTIX 1810
+# TIAA-CREF Institutional Fund - Lifecycle 2015: TCNIX 1811
+# TIAA-CREF Institutional Fund - Lifecycle 2020: TCWIX 1812
+# TIAA-CREF Institutional Fund - Lifecycle 2025: TCYIX 1813
+# TIAA-CREF Institutional Fund - Lifecycle 2030: TCRIX 1814
+# TIAA-CREF Institutional Fund - Lifecycle 2035: TCIIX 1815
+# TIAA-CREF Institutional Fund - Lifecycle 2040: TCOIX 1816
+# TIAA-CREF Institutional Fund - Lifecycle 2045: TTFIX 1817
+# TIAA-CREF Institutional Fund - Lifecycle 2050: TFTIX 1818
+# TIAA-CREF Institutional Fund - Lifecycle Retirement Income: TLRIX 1819
+# TIAA-CREF Institutional Fund - Managed Allocation: TIMIX 1825
+# TIAA-CREF Institutional Fund - Mid-Cap Growth: TRPWX 1602
+# TIAA-CREF Institutional Fund - Mid-Cap Value: TIMVX 1603
+# TIAA-CREF Institutional Fund - Money Market: TCIXX 1836
+# TIAA-CREF Institutional Fund - Real Estate Securities: TIREX 1604
+# TIAA-CREF Institutional Fund - S&P 500 Index: TISPX 1606
+# TIAA-CREF Institutional Fund - Short-Term Bond: TISIX 1828
+# TIAA-CREF Institutional Fund - Small-Cap Blend Index: TISBX 1612
+# TIAA-CREF Institutional Fund - Small-Cap Equity: TISEX 1634
+# TIAA-CREF Institutional Fund - Social Choice Equity: TISCX 1834
+# TIAA-CREF Institutional Fund - Tax-Exempt Bond: TITIX 1829
+
#
# This subroutine was written by Brent Neal
@@ -158,6 +235,84 @@ sub tiaacref
$tiaacref_ids{"TCSCX"} = "TIAA-CREF Social Choice Equity";
$tiaacref_ids{"TIMAX"} = "TIAA-CREF Managed Allocation";
+
+ # Retirement class funds
+ $tiaacref_ids{"TIDRX"} = "Retirement Fund - Bond";
+ $tiaacref_ids{"TBIRX"} = "Retirement Fund - Bond Index";
+ $tiaacref_ids{"TCBRX"} = "Retirement Fund - Bond Plus";
+ $tiaacref_ids{"TEMSX"} = "Retirement Fund - Emerging Markets Equity";
+ $tiaacref_ids{"TEQSX"} = "Retirement Fund - Emerging Markets Equity Index";
+ $tiaacref_ids{"TIQRX"} = "Retirement Fund - Equity Index";
+ $tiaacref_ids{"TRGIX"} = "Retirement Fund - Growth & Income";
+ $tiaacref_ids{"TIHRX"} = "Retirement Fund - High-Yield";
+ $tiaacref_ids{"TIKRX"} = "Retirement Fund - Inflation-Linked Bond";
+ $tiaacref_ids{"TRERX"} = "Retirement Fund - International Equity";
+ $tiaacref_ids{"TRIEX"} = "Retirement Fund - International Equity Index";
+ $tiaacref_ids{"TILRX"} = "Retirement Fund - Large-Cap Growth";
+ $tiaacref_ids{"TRIRX"} = "Retirement Fund - Large-Cap Growth Index";
+ $tiaacref_ids{"TRLCX"} = "Retirement Fund - Large-Cap Value";
+ $tiaacref_ids{"TRCVX"} = "Retirement Fund - Large-Cap Value Index";
+ $tiaacref_ids{"TCLEX"} = "Retirement Fund - Lifecycle 2010";
+ $tiaacref_ids{"TCLIX"} = "Retirement Fund - Lifecycle 2015";
+ $tiaacref_ids{"TCLTX"} = "Retirement Fund - Lifecycle 2020";
+ $tiaacref_ids{"TCLFX"} = "Retirement Fund - Lifecycle 2025";
+ $tiaacref_ids{"TCLNX"} = "Retirement Fund - Lifecycle 2030";
+ $tiaacref_ids{"TCLRX"} = "Retirement Fund - Lifecycle 2035";
+ $tiaacref_ids{"TCLOX"} = "Retirement Fund - Lifecycle 2040";
+ $tiaacref_ids{"TTFRX"} = "Retirement Fund - Lifecycle 2045";
+ $tiaacref_ids{"TLFRX"} = "Retirement Fund - Lifecycle 2050";
+ $tiaacref_ids{"TLIRX"} = "Retirement Fund - Lifecycle Retirement Income";
+ $tiaacref_ids{"TITRX"} = "Retirement Fund - Managed Allocation";
+ $tiaacref_ids{"TRGMX"} = "Retirement Fund - Mid-Cap Growth";
+ $tiaacref_ids{"TRVRX"} = "Retirement Fund - Mid-Cap Value";
+ $tiaacref_ids{"TIEXX"} = "Retirement Fund - Money Market";
+ $tiaacref_ids{"TRRSX"} = "Retirement Fund - Real Estate Securities";
+ $tiaacref_ids{"TRSPX"} = "Retirement Fund - S&P 500 Index";
+ $tiaacref_ids{"TISRX"} = "Retirement Fund - Short-Term Bond";
+ $tiaacref_ids{"TRBIX"} = "Retirement Fund - Small-Cap Blend Index";
+ $tiaacref_ids{"TRSEX"} = "Retirement Fund - Small-Cap Equity";
+ $tiaacref_ids{"TRSCX"} = "Retirement Fund - Social Choice Equity";
+
+ #Institutional class funds
+ $tiaacref_ids{"TIBDX"} = "Institutional Fund - Bond";
+ $tiaacref_ids{"TBIIX"} = "Institutional Fund - Bond Index";
+ $tiaacref_ids{"TIBFX"} = "Institutional Fund - Bond Plus";
+ $tiaacref_ids{"TEMLX"} = "Institutional Fund - Emerging Markets Equity";
+ $tiaacref_ids{"TEQLX"} = "Institutional Fund - Emerging Markets Equity Index";
+ $tiaacref_ids{"TFIIX"} = "Institutional Fund - Enhanced International Equity Index";
+ $tiaacref_ids{"TLIIX"} = "Institutional Fund - Enhanced Large-Cap Growth Index";
+ $tiaacref_ids{"TEVIX"} = "Institutional Fund - Enhanced Large-Cap Value Index";
+ $tiaacref_ids{"TIEIX"} = "Institutional Fund - Equity Index";
+ $tiaacref_ids{"TIGRX"} = "Institutional Fund - Growth & Income";
+ $tiaacref_ids{"TIHYX"} = "Institutional Fund - High-Yield";
+ $tiaacref_ids{"TIILX"} = "Institutional Fund - Inflation-Linked Bond";
+ $tiaacref_ids{"TIIEX"} = "Institutional Fund - International Equity";
+ $tiaacref_ids{"TCIEX"} = "Institutional Fund - International Equity Index";
+ $tiaacref_ids{"TILGX"} = "Institutional Fund - Large-Cap Growth";
+ $tiaacref_ids{"TILIX"} = "Institutional Fund - Large-Cap Growth Index";
+ $tiaacref_ids{"TRLIX"} = "Institutional Fund - Large-Cap Value";
+ $tiaacref_ids{"TILVX"} = "Institutional Fund - Large-Cap Value Index";
+ $tiaacref_ids{"TCTIX"} = "Institutional Fund - Lifecycle 2010";
+ $tiaacref_ids{"TCNIX"} = "Institutional Fund - Lifecycle 2015";
+ $tiaacref_ids{"TCWIX"} = "Institutional Fund - Lifecycle 2020";
+ $tiaacref_ids{"TCYIX"} = "Institutional Fund - Lifecycle 2025";
+ $tiaacref_ids{"TCRIX"} = "Institutional Fund - Lifecycle 2030";
+ $tiaacref_ids{"TCIIX"} = "Institutional Fund - Lifecycle 2035";
+ $tiaacref_ids{"TCOIX"} = "Institutional Fund - Lifecycle 2040";
+ $tiaacref_ids{"TTFIX"} = "Institutional Fund - Lifecycle 2045";
+ $tiaacref_ids{"TFTIX"} = "Institutional Fund - Lifecycle 2050";
+ $tiaacref_ids{"TLRIX"} = "Institutional Fund - Lifecycle Retirement Income";
+ $tiaacref_ids{"TIMIX"} = "Institutional Fund - Managed Allocation";
+ $tiaacref_ids{"TRPWX"} = "Institutional Fund - Mid-Cap Growth";
+ $tiaacref_ids{"TIMVX"} = "Institutional Fund - Mid-Cap Value";
+ $tiaacref_ids{"TCIXX"} = "Institutional Fund - Money Market";
+ $tiaacref_ids{"TIREX"} = "Institutional Fund - Real Estate Securities";
+ $tiaacref_ids{"TISPX"} = "Institutional Fund - S&P 500 Index";
+ $tiaacref_ids{"TISIX"} = "Institutional Fund - Short-Term Bond";
+ $tiaacref_ids{"TISBX"} = "Institutional Fund - Small-Cap Blend Index";
+ $tiaacref_ids{"TISEX"} = "Institutional Fund - Small-Cap Equity";
+ $tiaacref_ids{"TISCX"} = "Institutional Fund - Social Choice Equity";
+ $tiaacref_ids{"TITIX"} = "Institutional Fund - Tax-Exempt Bond";
}
if (! %tiaacref_vals) {
@@ -201,6 +356,82 @@ sub tiaacref
$tiaacref_vals{"TCSCX"} = "83";
$tiaacref_vals{"TIMAX"} = "74";
+
+ $tiaacref_vals{"TIDRX"} = "1641";
+ $tiaacref_vals{"TBIRX"} = "1660";
+ $tiaacref_vals{"TCBRX"} = "1638";
+ $tiaacref_vals{"TEMSX"} = "1671";
+ $tiaacref_vals{"TEQSX"} = "1672";
+ $tiaacref_vals{"TIQRX"} = "1643";
+ $tiaacref_vals{"TRGIX"} = "1616";
+ $tiaacref_vals{"TIHRX"} = "1637";
+ $tiaacref_vals{"TIKRX"} = "1640";
+ $tiaacref_vals{"TRERX"} = "1618";
+ $tiaacref_vals{"TRIEX"} = "1632";
+ $tiaacref_vals{"TILRX"} = "1635";
+ $tiaacref_vals{"TRIRX"} = "1624";
+ $tiaacref_vals{"TRLCX"} = "1619";
+ $tiaacref_vals{"TRCVX"} = "1625";
+ $tiaacref_vals{"TCLEX"} = "1650";
+ $tiaacref_vals{"TCLIX"} = "1651";
+ $tiaacref_vals{"TCLTX"} = "1652";
+ $tiaacref_vals{"TCLFX"} = "1653";
+ $tiaacref_vals{"TCLNX"} = "1654";
+ $tiaacref_vals{"TCLRX"} = "1655";
+ $tiaacref_vals{"TCLOX"} = "1656";
+ $tiaacref_vals{"TTFRX"} = "1657";
+ $tiaacref_vals{"TLFRX"} = "1658";
+ $tiaacref_vals{"TLIRX"} = "1659";
+ $tiaacref_vals{"TITRX"} = "1636";
+ $tiaacref_vals{"TRGMX"} = "1620";
+ $tiaacref_vals{"TRVRX"} = "1621";
+ $tiaacref_vals{"TIEXX"} = "1642";
+ $tiaacref_vals{"TRRSX"} = "1622";
+ $tiaacref_vals{"TRSPX"} = "1623";
+ $tiaacref_vals{"TISRX"} = "1639";
+ $tiaacref_vals{"TRBIX"} = "1629";
+ $tiaacref_vals{"TRSEX"} = "1633";
+ $tiaacref_vals{"TRSCX"} = "1617";
+
+ $tiaacref_vals{"TIBDX"} = "1835";
+ $tiaacref_vals{"TBIIX"} = "1837";
+ $tiaacref_vals{"TIBFX"} = "1827";
+ $tiaacref_vals{"TEMLX"} = "1848";
+ $tiaacref_vals{"TEQLX"} = "1849";
+ $tiaacref_vals{"TFIIX"} = "1822";
+ $tiaacref_vals{"TLIIX"} = "1820";
+ $tiaacref_vals{"TEVIX"} = "1821";
+ $tiaacref_vals{"TIEIX"} = "1833";
+ $tiaacref_vals{"TIGRX"} = "1832";
+ $tiaacref_vals{"TIHYX"} = "1826";
+ $tiaacref_vals{"TIILX"} = "1605";
+ $tiaacref_vals{"TIIEX"} = "1830";
+ $tiaacref_vals{"TCIEX"} = "1615";
+ $tiaacref_vals{"TILGX"} = "1824";
+ $tiaacref_vals{"TILIX"} = "1607";
+ $tiaacref_vals{"TRLIX"} = "1601";
+ $tiaacref_vals{"TILVX"} = "1608";
+ $tiaacref_vals{"TCTIX"} = "1810";
+ $tiaacref_vals{"TCNIX"} = "1811";
+ $tiaacref_vals{"TCWIX"} = "1812";
+ $tiaacref_vals{"TCYIX"} = "1813";
+ $tiaacref_vals{"TCRIX"} = "1814";
+ $tiaacref_vals{"TCIIX"} = "1815";
+ $tiaacref_vals{"TCOIX"} = "1816";
+ $tiaacref_vals{"TTFIX"} = "1817";
+ $tiaacref_vals{"TFTIX"} = "1818";
+ $tiaacref_vals{"TLRIX"} = "1819";
+ $tiaacref_vals{"TIMIX"} = "1825";
+ $tiaacref_vals{"TRPWX"} = "1602";
+ $tiaacref_vals{"TIMVX"} = "1603";
+ $tiaacref_vals{"TCIXX"} = "1836";
+ $tiaacref_vals{"TIREX"} = "1604";
+ $tiaacref_vals{"TISPX"} = "1606";
+ $tiaacref_vals{"TISIX"} = "1828";
+ $tiaacref_vals{"TISBX"} = "1612";
+ $tiaacref_vals{"TISEX"} = "1634";
+ $tiaacref_vals{"TISCX"} = "1834";
+ $tiaacref_vals{"TITIX"} = "1829";
}
#The location doesn't matter anymore.
@@ -248,16 +479,93 @@ sub tiaacref
$tiaacref_locs{"TCSCX"} = 1;
$tiaacref_locs{"TIMAX"} = 1;
+
+ $tiaacref_locs{"TIDRX"} = 1;
+ $tiaacref_locs{"TBIRX"} = 1;
+ $tiaacref_locs{"TCBRX"} = 1;
+ $tiaacref_locs{"TEMSX"} = 1;
+ $tiaacref_locs{"TEQSX"} = 1;
+ $tiaacref_locs{"TIQRX"} = 1;
+ $tiaacref_locs{"TRGIX"} = 1;
+ $tiaacref_locs{"TIHRX"} = 1;
+ $tiaacref_locs{"TIKRX"} = 1;
+ $tiaacref_locs{"TRERX"} = 1;
+ $tiaacref_locs{"TRIEX"} = 1;
+ $tiaacref_locs{"TILRX"} = 1;
+ $tiaacref_locs{"TRIRX"} = 1;
+ $tiaacref_locs{"TRLCX"} = 1;
+ $tiaacref_locs{"TRCVX"} = 1;
+ $tiaacref_locs{"TCLEX"} = 1;
+ $tiaacref_locs{"TCLIX"} = 1;
+ $tiaacref_locs{"TCLTX"} = 1;
+ $tiaacref_locs{"TCLFX"} = 1;
+ $tiaacref_locs{"TCLNX"} = 1;
+ $tiaacref_locs{"TCLRX"} = 1;
+ $tiaacref_locs{"TCLOX"} = 1;
+ $tiaacref_locs{"TTFRX"} = 1;
+ $tiaacref_locs{"TLFRX"} = 1;
+ $tiaacref_locs{"TLIRX"} = 1;
+ $tiaacref_locs{"TITRX"} = 1;
+ $tiaacref_locs{"TRGMX"} = 1;
+ $tiaacref_locs{"TRVRX"} = 1;
+ $tiaacref_locs{"TIEXX"} = 1;
+ $tiaacref_locs{"TRRSX"} = 1;
+ $tiaacref_locs{"TRSPX"} = 1;
+ $tiaacref_locs{"TISRX"} = 1;
+ $tiaacref_locs{"TRBIX"} = 1;
+ $tiaacref_locs{"TRSEX"} = 1;
+ $tiaacref_locs{"TRSCX"} = 1;
+
+ $tiaacref_locs{"TIBDX"} = 3;
+ $tiaacref_locs{"TBIIX"} = 3;
+ $tiaacref_locs{"TIBFX"} = 3;
+ $tiaacref_locs{"TEMLX"} = 3;
+ $tiaacref_locs{"TEQLX"} = 3;
+ $tiaacref_locs{"TFIIX"} = 3;
+ $tiaacref_locs{"TLIIX"} = 3;
+ $tiaacref_locs{"TEVIX"} = 3;
+ $tiaacref_locs{"TIEIX"} = 3;
+ $tiaacref_locs{"TIGRX"} = 3;
+ $tiaacref_locs{"TIHYX"} = 3;
+ $tiaacref_locs{"TIILX"} = 3;
+ $tiaacref_locs{"TIIEX"} = 3;
+ $tiaacref_locs{"TCIEX"} = 3;
+ $tiaacref_locs{"TILGX"} = 3;
+ $tiaacref_locs{"TILIX"} = 3;
+ $tiaacref_locs{"TRLIX"} = 3;
+ $tiaacref_locs{"TILVX"} = 3;
+ $tiaacref_locs{"TCTIX"} = 3;
+ $tiaacref_locs{"TCNIX"} = 3;
+ $tiaacref_locs{"TCWIX"} = 3;
+ $tiaacref_locs{"TCYIX"} = 3;
+ $tiaacref_locs{"TCRIX"} = 3;
+ $tiaacref_locs{"TCIIX"} = 3;
+ $tiaacref_locs{"TCOIX"} = 3;
+ $tiaacref_locs{"TTFIX"} = 3;
+ $tiaacref_locs{"TFTIX"} = 3;
+ $tiaacref_locs{"TLRIX"} = 3;
+ $tiaacref_locs{"TIMIX"} = 3;
+ $tiaacref_locs{"TRPWX"} = 3;
+ $tiaacref_locs{"TIMVX"} = 3;
+ $tiaacref_locs{"TCIXX"} = 3;
+ $tiaacref_locs{"TIREX"} = 3;
+ $tiaacref_locs{"TISPX"} = 3;
+ $tiaacref_locs{"TISIX"} = 3;
+ $tiaacref_locs{"TISBX"} = 3;
+ $tiaacref_locs{"TISEX"} = 3;
+ $tiaacref_locs{"TISCX"} = 3;
+ $tiaacref_locs{"TITIX"} = 3;
}
my(@funds) = @_;
return unless @funds;
my(@line); #holds the return from parse_csv
my(%info);
my(%check); #holds success value if data returned
- my($ua,$urlc,$urlt); #useragent and target urls
- my($cntc,$cntt); #counters for each of the two url containers
+ my($ua,$urlc,$urlci,$urlt); #useragent and target urls
+ my($cntc,$cntci,$cntt); #counters for each of the two url containers
my($reply,$qdata); #the reply from TIAA-CREF's cgi and a buffer for the data
my $cbResult = 'cbResults=';
+ my $cbResulti = 'cbResults=';
my ($Fsec,$Fmin,$Fhour,$Fmday,$Fmon,$Fyear,$Fwday,$Fyday,$Fisdst) = localtime(time() - 24 * 60 * 60);
my ($Tsec,$Tmin,$Thour,$Tmday,$Tmon,$Tyear,$Twday,$Tyday,$Tisdst) = localtime(time());
@@ -272,11 +580,22 @@ sub tiaacref
$urlc .= "&toyear=" . ($Tyear + 1900);
$urlc .= "&sqlorder=desc&dldformat=1&submit.x=29&submit.y=7";
+ $urlci = $CREF_URL_INST;
+ $urlci .= "page=input";
+ $urlci .= "&frommonth=" . ($Fmon + 1);
+ $urlci .= "&fromday=" . ($Fmday);
+ $urlci .= "&fromyear=" . ($Fyear + 1900);
+ $urlci .= "&tomonth=" . ($Tmon + 1);
+ $urlci .= "&today=" . ($Tmday);
+ $urlci .= "&toyear=" . ($Tyear + 1900);
+ $urlci .= "&sqlorder=desc&dldformat=1&submit.x=29&submit.y=7";
+
$urlt = $TIAA_URL;
#Initialize counters for the two types of URL. If either counter is zero, then
# that URL will not be retrieved. This is less technically clever than testing
#the URL string itself with m/yes/, but its faster.
$cntc = 0;
+ $cntci = 0;
$cntt = 0;
foreach my $fund (@funds) {
if ($tiaacref_ids{$fund}) {
@@ -284,6 +603,10 @@ sub tiaacref
$cntc++;
$urlc .= "&fundid" . $tiaacref_vals{$fund} . "=" . $tiaacref_vals{$fund};
$cbResult .= ($cntc > 1) ? ( "%2C" . $tiaacref_vals{$fund}) : ($tiaacref_vals{$fund})
+ } elsif ($tiaacref_locs{$fund} == 3) {
+ $cntci++;
+ $urlci .= "&fundid" . $tiaacref_vals{$fund} . "=" . $tiaacref_vals{$fund};
+ $cbResulti .= ($cntci > 1) ? ( "%2C" . $tiaacref_vals{$fund}) : ($tiaacref_vals{$fund})
} else {
$urlt .= $fund . "=yes&";
$cntt++;
@@ -295,6 +618,7 @@ sub tiaacref
}
}
$urlc .= "&$cbResult";
+ $urlci .= "&$cbResulti";
$urlt .= "selected=1";
$qdata ="";
@@ -305,6 +629,12 @@ sub tiaacref
$qdata .= $reply->content;
}
}
+ if ($cntci) {
+ $reply = $ua->request(GET $urlci);
+ if ($reply ->is_success) {
+ $qdata .= $reply->content;
+ }
+ }
if ($cntt) {
$reply = $ua->request(GET $urlt);
if ($reply ->is_success) {
@@ -315,6 +645,7 @@ sub tiaacref
if (length($qdata)) {
foreach (split(/
/,$qdata) ){
next unless m/.+,.+/;
+ s/[\r\n]+//g;
s/^ +//g;
s/ +$//g;
@line = $quoter->parse_csv($_);
@@ -416,6 +747,82 @@ The following symbols can be used:
TIAA-CREF Social Choice Equity: TCSCX
TIAA-CREF Managed Allocation: TIMAX
+ TIAA-CREF Retirement Fund - Bond: TIDRX
+ TIAA-CREF Retirement Fund - Bond Index: TBIRX
+ TIAA-CREF Retirement Fund - Bond Plus: TCBRX
+ TIAA-CREF Retirement Fund - Emerging Markets Equity: TEMSX
+ TIAA-CREF Retirement Fund - Emerging Markets Equity Index: TEQSX
+ TIAA-CREF Retirement Fund - Equity Index: TIQRX
+ TIAA-CREF Retirement Fund - Growth & Income: TRGIX
+ TIAA-CREF Retirement Fund - High-Yield: TIHRX
+ TIAA-CREF Retirement Fund - Inflation-Linked Bond: TIKRX
+ TIAA-CREF Retirement Fund - International Equity: TRERX
+ TIAA-CREF Retirement Fund - International Equity Index: TRIEX
+ TIAA-CREF Retirement Fund - Large-Cap Growth: TILRX
+ TIAA-CREF Retirement Fund - Large-Cap Growth Index: TRIRX
+ TIAA-CREF Retirement Fund - Large-Cap Value: TRLCX
+ TIAA-CREF Retirement Fund - Large-Cap Value Index: TRCVX
+ TIAA-CREF Retirement Fund - Lifecycle 2010: TCLEX
+ TIAA-CREF Retirement Fund - Lifecycle 2015: TCLIX
+ TIAA-CREF Retirement Fund - Lifecycle 2020: TCLTX
+ TIAA-CREF Retirement Fund - Lifecycle 2025: TCLFX
+ TIAA-CREF Retirement Fund - Lifecycle 2030: TCLNX
+ TIAA-CREF Retirement Fund - Lifecycle 2035: TCLRX
+ TIAA-CREF Retirement Fund - Lifecycle 2040: TCLOX
+ TIAA-CREF Retirement Fund - Lifecycle 2045: TTFRX
+ TIAA-CREF Retirement Fund - Lifecycle 2050: LFRX
+ TIAA-CREF Retirement Fund - Lifecycle Retirement Income: TLIRX
+ TIAA-CREF Retirement Fund - Managed Allocation: TITRX
+ TIAA-CREF Retirement Fund - Mid-Cap Growth: TRGMX
+ TIAA-CREF Retirement Fund - Mid-Cap Value: TRVRX
+ TIAA-CREF Retirement Fund - Money Market: TIEXX
+ TIAA-CREF Retirement Fund - Real Estate Securities: TRRSX
+ TIAA-CREF Retirement Fund - S&P 500 Index: TRSPX
+ TIAA-CREF Retirement Fund - Short-Term Bond: TISRX
+ TIAA-CREF Retirement Fund - Cap Blend Index: TRBIX
+ TIAA-CREF Retirement Fund - Small-Cap Equity: TRSEX
+ TIAA-CREF Retirement Fund - Social Choice Equity: TRSCX
+
+ TIAA-CREF Institutional Fund - Bond: TIBDX
+ TIAA-CREF Institutional Fund - Bond Index: TBIIX
+ TIAA-CREF Institutional Fund - Bond Plus: TIBFX
+ TIAA-CREF Institutional Fund - Emerging Markets Equity: TEMLX
+ TIAA-CREF Institutional Fund - Emerging Markets Equity Index: TEQLX
+ TIAA-CREF Institutional Fund - Enhanced International Equity Index: TFIIX
+ TIAA-CREF Institutional Fund - Enhanced Large-Cap Growth Index: TLIIX
+ TIAA-CREF Institutional Fund - Enhanced Large-Cap Value Index: TEVIX
+ TIAA-CREF Institutional Fund - Equity Index: TIEIX
+ TIAA-CREF Institutional Fund - Growth & Income: TIGRX
+ TIAA-CREF Institutional Fund - High-Yield: TIHYX
+ TIAA-CREF Institutional Fund - Inflation-Linked Bond: TIILX
+ TIAA-CREF Institutional Fund - International Equity: TIIEX
+ TIAA-CREF Institutional Fund - International Equity Index: TCIEX
+ TIAA-CREF Institutional Fund - Large-Cap Growth: TILGX
+ TIAA-CREF Institutional Fund - Large-Cap Growth Index: TILIX
+ TIAA-CREF Institutional Fund - Large-Cap Value: TRLIX
+ TIAA-CREF Institutional Fund - Large-Cap Value Index: TILVX
+ TIAA-CREF Institutional Fund - Lifecycle 2010: TCTIX
+ TIAA-CREF Institutional Fund - Lifecycle 2015: TCNIX
+ TIAA-CREF Institutional Fund - Lifecycle 2020: TCWIX
+ TIAA-CREF Institutional Fund - Lifecycle 2025: TCYIX
+ TIAA-CREF Institutional Fund - Lifecycle 2030: TCRIX
+ TIAA-CREF Institutional Fund - Lifecycle 2035: TCIIX
+ TIAA-CREF Institutional Fund - Lifecycle 2040: TCOIX
+ TIAA-CREF Institutional Fund - Lifecycle 2045: TTFIX
+ TIAA-CREF Institutional Fund - Lifecycle 2050: TFTIX
+ TIAA-CREF Institutional Fund - Lifecycle Retirement Income: TLRIX
+ TIAA-CREF Institutional Fund - Managed Allocation: TIMIX
+ TIAA-CREF Institutional Fund - Mid-Cap Growth: TRPWX
+ TIAA-CREF Institutional Fund - Mid-Cap Value: TIMVX
+ TIAA-CREF Institutional Fund - Money Market: TCIXX
+ TIAA-CREF Institutional Fund - Real Estate Securities: TIREX
+ TIAA-CREF Institutional Fund - S&P 500 Index: TISPX
+ TIAA-CREF Institutional Fund - Short-Term Bond: TISIX
+ TIAA-CREF Institutional Fund - Small-Cap Blend Index: TISBX
+ TIAA-CREF Institutional Fund - Small-Cap Equity: TISEX
+ TIAA-CREF Institutional Fund - Social Choice Equity: TISCX
+ TIAA-CREF Institutional Fund - Tax-Exempt Bond: TITIX
+
This module is loaded by default on a Finance::Quote object. It's
also possible to load it explicitly by passing "Tiaacref" in to the
++++++ perl-Finance-Quote-fsf-address.patch ++++++
++++ 622 lines (skipped)
++++++ perl-Finance-Quote-goldmoney-decimal-point.patch ++++++
Index: finance-quote/lib/Finance/Quote/GoldMoney.pm
===================================================================
--- finance-quote.orig/lib/Finance/Quote/GoldMoney.pm
+++ finance-quote/lib/Finance/Quote/GoldMoney.pm
@@ -131,6 +131,7 @@ sub goldmoney {
if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
$gold_oz = $1;
+ $gold_oz =~ s/,//;
}
# assemble final dataset
@@ -152,6 +153,7 @@ sub goldmoney {
if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
$silver_oz = $1;
+ $silver_oz =~ s/,//;
}
# assemble final dataset
@@ -173,6 +175,7 @@ sub goldmoney {
if( $_->as_text =~ /([\d,]*\.\d*)/ ) {
$platinum_oz = $1;
+ $platinum_oz =~ s/,//;
}
# assemble final dataset
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org