diff options
author | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2010-11-06 22:00:22 +0000 |
---|---|---|
committer | Sunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2010-11-06 22:00:22 +0000 |
commit | 318f8b3ed2cac9808416207b7fddf0e7b3f7230f (patch) | |
tree | 89bdb024d3d6af40b9c61010878ddcaaccde162e /finance | |
parent | d79412e966c266323f6f9af06bc0f874ca625005 (diff) |
- Add upstream patches, including:
- Add BSERO
- Update Bourso, Tiaacref and TSP
- Add LICENSE
- Sort PLIST
- Update pkg-descr
- Bump PORTREVISION
- Take maintainership
Notes
Notes:
svn path=/head/; revision=264164
Diffstat (limited to 'finance')
-rw-r--r-- | finance/p5-Finance-Quote/Makefile | 72 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/distinfo | 1 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-BSERO.pm | 188 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Bourso.pm | 91 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-TSP.pm | 13 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Tiaacref.pm | 74 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/files/patch-lib-Finance-Quote.pm | 13 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/files/patch-t-bsero.t | 50 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/pkg-descr | 2 | ||||
-rw-r--r-- | finance/p5-Finance-Quote/pkg-plist | 11 |
10 files changed, 487 insertions, 28 deletions
diff --git a/finance/p5-Finance-Quote/Makefile b/finance/p5-Finance-Quote/Makefile index b055ddc506d4..d23a566beb08 100644 --- a/finance/p5-Finance-Quote/Makefile +++ b/finance/p5-Finance-Quote/Makefile @@ -7,11 +7,12 @@ PORTNAME= Finance-Quote PORTVERSION= 1.17 +PORTREVISION= 1 CATEGORIES= finance perl5 MASTER_SITES= CPAN PKGNAMEPREFIX= p5- -MAINTAINER= ports@FreeBSD.org +MAINTAINER= sunpoet@FreeBSD.org COMMENT= Get stock and mutual fund quotes from various exchanges BUILD_DEPENDS= ${SITE_PERL}/HTML/TableExtract.pm:${PORTSDIR}/www/p5-HTML-TableExtract \ @@ -20,32 +21,59 @@ BUILD_DEPENDS= ${SITE_PERL}/HTML/TableExtract.pm:${PORTSDIR}/www/p5-HTML-TableEx ${SITE_PERL}/LWP/UserAgent.pm:${PORTSDIR}/www/p5-libwww RUN_DEPENDS= ${BUILD_DEPENDS} +LICENSE= GPLv2 GPLv3 +LICENSE_COMB= dual + PERL_CONFIGURE= yes -MAN3= Finance::Quote.3 Finance::Quote::AEX.3 \ - Finance::Quote::AIAHK.3 Finance::Quote::ASEGR.3 \ - Finance::Quote::ASX.3 Finance::Quote::BMONesbittBurns.3 \ - Finance::Quote::Bourso.3 Finance::Quote::Cdnfundlibrary.3 \ +MAN3= Finance::Quote.3 \ + Finance::Quote::AEX.3 \ + Finance::Quote::AIAHK.3 \ + Finance::Quote::ASEGR.3 \ + Finance::Quote::ASX.3 \ + Finance::Quote::BMONesbittBurns.3 \ + Finance::Quote::BSERO.3 \ + Finance::Quote::Bourso.3 \ + Finance::Quote::Cdnfundlibrary.3 \ + Finance::Quote::Cominvest.3 \ Finance::Quote::Currencies.3 \ - Finance::Quote::Cominvest.3 Finance::Quote::DWS.3 \ - Finance::Quote::Deka.3 Finance::Quote::FTPortfolios.3 \ - Finance::Quote::Fidelity.3 Finance::Quote::FinanceCanada.3 \ - Finance::Quote::Finanzpartner.3 Finance::Quote::Fool.3 \ + Finance::Quote::DWS.3 \ + Finance::Quote::Deka.3 \ + Finance::Quote::FTPortfolios.3 \ + Finance::Quote::Fidelity.3 \ + Finance::Quote::FinanceCanada.3 \ + Finance::Quote::Finanzpartner.3 \ + Finance::Quote::Fool.3 \ Finance::Quote::GoldMoney.3 \ - Finance::Quote::HEX.3 Finance::Quote::IndiaMutual.3 \ - Finance::Quote::LeRevenu.3 Finance::Quote::ManInvestments.3 \ + Finance::Quote::HEX.3 \ + Finance::Quote::HU.3 \ + Finance::Quote::IndiaMutual.3 \ + Finance::Quote::LeRevenu.3 \ + Finance::Quote::ManInvestments.3 \ Finance::Quote::Morningstar.3 \ - Finance::Quote::NZX.3 Finance::Quote::Platinum.3 \ - Finance::Quote::SEB.3 Finance::Quote::TSP.3 \ - Finance::Quote::TSX.3 Finance::Quote::Tdefunds.3 \ - Finance::Quote::Tdwaterhouse.3 Finance::Quote::Tiaacref.3 \ - Finance::Quote::Troweprice.3 Finance::Quote::Trustnet.3 \ - Finance::Quote::USFedBonds.3 Finance::Quote::Union.3 \ - Finance::Quote::VWD.3 Finance::Quote::Yahoo::Asia.3 \ + Finance::Quote::NZX.3 \ + Finance::Quote::Platinum.3 \ + Finance::Quote::SEB.3 \ + Finance::Quote::TSP.3 \ + Finance::Quote::TSX.3 \ + Finance::Quote::Tdefunds.3 \ + Finance::Quote::Tdwaterhouse.3 \ + Finance::Quote::Tiaacref.3 \ + Finance::Quote::Troweprice.3 \ + Finance::Quote::Trustnet.3 \ + Finance::Quote::USFedBonds.3 \ + Finance::Quote::Union.3 \ + Finance::Quote::VWD.3 \ + Finance::Quote::Yahoo::Asia.3 \ Finance::Quote::Yahoo::Australia.3 \ - Finance::Quote::Yahoo::Base.3 Finance::Quote::Yahoo::Brasil.3 \ - Finance::Quote::Yahoo::Europe.3 Finance::Quote::Yahoo::NZ.3 \ - Finance::Quote::Yahoo::USA.3 Finance::Quote::ZA.3 \ - Finance::Quote::HU.3 + Finance::Quote::Yahoo::Base.3 \ + Finance::Quote::Yahoo::Brasil.3 \ + Finance::Quote::Yahoo::Europe.3 \ + Finance::Quote::Yahoo::NZ.3 \ + Finance::Quote::Yahoo::USA.3 \ + Finance::Quote::ZA.3 + +post-patch: + @${FIND} ${WRKSRC}/lib/Finance/ -name '*.orig' -delete .include <bsd.port.mk> diff --git a/finance/p5-Finance-Quote/distinfo b/finance/p5-Finance-Quote/distinfo index cd6c00c1c6b9..92b832bc8fdf 100644 --- a/finance/p5-Finance-Quote/distinfo +++ b/finance/p5-Finance-Quote/distinfo @@ -1,3 +1,2 @@ -MD5 (Finance-Quote-1.17.tar.gz) = 446dba3837ffa395bffdea268824e0c1 SHA256 (Finance-Quote-1.17.tar.gz) = 10c3e7d98e71997f7e32bff5898ff5153c9ebf1b46063f91c184db8e6089e170 SIZE (Finance-Quote-1.17.tar.gz) = 130686 diff --git a/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-BSERO.pm b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-BSERO.pm new file mode 100644 index 000000000000..1d9ea83bcfa6 --- /dev/null +++ b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-BSERO.pm @@ -0,0 +1,188 @@ +http://github.com/pfenwick/finance-quote/commit/7de984bea80e9c5e00504ededba6897183bb8c45 + +--- lib/Finance/Quote/BSERO.pm.orig 1970-01-01 08:00:00.000000000 +0800 ++++ lib/Finance/Quote/BSERO.pm 2010-02-13 18:25:22.000000000 +0800 +@@ -0,0 +1,183 @@ ++#!/usr/bin/perl -w ++# This modules is based on the Finance::Quote::ASEGR module ++# ++# The code has been modified by Andrei Cipu <strainu@strainu.ro> to be able to ++# retrieve stock information from the Bucharest Exchange in Romania. ++# ++# 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 ++require 5.005; ++ ++use strict; ++ ++package Finance::Quote::BSERO; ++ ++use vars qw($VERSION $BSERO_URL); ++ ++use LWP::UserAgent; ++use HTTP::Request::Common; ++use HTML::TableExtract; ++ ++$VERSION='0.1'; ++ ++my $BSERO_URL = 'http://www.bvb.ro/mobile/m_SecurityDetails.aspx?'; ++ ++ ++sub methods { return ( romania => \&bsero, ++ bsero => \&bsero, ++ europe => \&bsero); } ++{ ++ my @labels = qw/name last date isodate p_change open high low close volume currency method exchange/; ++ ++ sub labels { return (romania => \@labels, ++ bsero => \@labels, ++ europe => \@labels); } ++} ++ ++sub bsero { ++ ++ my $quoter = shift; ++ my @stocks = @_; ++ my (%info,$reply,$url,$te,$ts,$row,@cells, $ce); ++ my($my_date,$my_last,$my_p_change,$my_volume,$my_high,$my_low,$my_open); ++ my $ua = $quoter->user_agent(); ++ ++ $url = $BSERO_URL; ++ ++ foreach my $stocks (@stocks) ++ { ++ $reply = $ua->request(GET $url.join('',"s=",$stocks)); ++ ++ if ($reply->is_success) ++ { ++ ++ $te = new HTML::TableExtract(); ++ ++ $te->parse($reply->content); ++ ++ unless ( $te->tables) ++ { ++ $info {$stocks,"success"} = 0; ++ $info {$stocks,"errormsg"} = "Stock name $stocks not found"; ++ next; ++ } ++ ++ $ts = $te->first_table_found(); ++ ++ foreach $row ($ts->rows) { ++ @cells = @$row; ++ ++ # The date is not a number, so we don't bother modifying it ++ if($cells[0] eq 'Data'){ ++ $my_date = $cells[1]; ++ } ++ #The rest of the data needs to be modified ++ else { ++ foreach $ce (@cells) { ++ next unless $ce; ++ $ce =~ s/\.//; #remove thouthand separator ++ $ce =~ s/,/\./g; #replace european decimal separator with american ones ++ } ++ ++ #go through each row and get the data ++ if($cells[0] eq 'Ultimul pret'){ ++ $my_last = $cells[1]; ++ } ++ if($cells[0] eq 'Var (%)'){ ++ $my_p_change = $cells[1]; ++ } ++ if($cells[0] eq 'Volum'){ ++ $my_volume = $cells[1]; ++ } ++ if($cells[0] eq 'Pret maxim'){ ++ $my_high = $cells[1]; ++ } ++ if($cells[0] eq 'Pret minim'){ ++ $my_low = $cells[1]; ++ } ++ if($cells[0] eq 'Pret deschidere'){ ++ $my_open = $cells[1]; ++ } ++ } ++ } ++ ++ $info{$stocks, "success"} =1; ++ $info{$stocks, "exchange"} ="Bucharest Stock Exchange"; ++ $info{$stocks, "method"} ="bsero"; ++ $info{$stocks, "name"} =$stocks; ++ $info{$stocks, "last"} =$my_last; ++ $info{$stocks, "close"} =$my_last; ++ $info{$stocks, "p_change"} =$my_p_change; ++ $info{$stocks, "volume"} =$my_volume; ++ $info{$stocks, "high"} =$my_high; ++ $info{$stocks, "low"} =$my_low; ++ $info{$stocks, "open"} =$my_open; ++ ++ $quoter->store_date(\%info, $stocks, {eurodate => $my_date}); ++ ++ $info{$stocks,"currency"} = "RON"; ++ ++ } else { ++ $info{$stocks, "success"}=0; ++ $info{$stocks, "errormsg"}="Error retreiving $stocks "; ++ } ++ } ++ return wantarray() ? %info : \%info; ++ return \%info; ++} ++ ++1; ++ ++=head1 NAME ++ ++Finance::Quote::BSERO Obtain quotes from Bucharest Stock Exchange. ++ ++=head1 SYNOPSIS ++ ++ use Finance::Quote; ++ ++ $q = Finance::Quote->new; ++ ++ %info = Finance::Quote->fetch("bsero","tlv"); # Only query BSERO ++ %info = Finance::Quote->fetch("romania","brd"); # Failover to other sources OK. ++ ++=head1 DESCRIPTION ++ ++This module fetches information from the "Bucharest Stock Exchange" ++(Bursa de Valori Bucuresti), http://www.bvb.ro. All stocks are available. ++ ++This module is loaded by default on a Finance::Quote object. It's ++also possible to load it explicity by placing "BSERO" in the argument ++list to Finance::Quote->new(). ++ ++This module provides both the "bsero" and "romania" fetch methods. ++Please use the "romania" fetch method if you wish to have failover ++with future sources for Romanian stocks. Using the "bsero" method will ++guarantee that your information only comes from the Bucharest Stock Exchange. ++ ++Information obtained by this module may be covered by www.bvb.go ++terms and conditions See http://www.bvb.ro/ for details. ++ ++=head1 LABELS RETURNED ++ ++The following labels may be returned by Finance::Quote::BSERO : ++name, last, date, p_change, open, high, low, close, ++volume, currency, method, exchange. ++ ++=head1 SEE ALSO ++ ++Bucharest Stock Exchange, http://www.bvb.ro ++ ++=cut diff --git a/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Bourso.pm b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Bourso.pm new file mode 100644 index 000000000000..19b1148b2d33 --- /dev/null +++ b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Bourso.pm @@ -0,0 +1,91 @@ +http://github.com/pfenwick/finance-quote/commit/092599c712f19e7ddeb568340d42c816c9e1ed32 + +--- lib/Finance/Quote/Bourso.pm.orig 2009-10-06 01:39:57.000000000 +0800 ++++ lib/Finance/Quote/Bourso.pm 2010-02-13 18:25:22.000000000 +0800 +@@ -121,7 +121,7 @@ + }; + + my $symbol = $symbolline[0]->as_text; +- ($symbol) = ($symbol=~m/(\w+)-/); ++ ($symbol) = ($symbol=~m/(\w+) ?-/); + $info{$stocks,"symbol"}=$symbol; + + # retrieve NAME +@@ -139,31 +139,71 @@ + # set method + $info{$stocks,"method"} = "bourso" ; + ++ #holds table data ++ my %tempinfo; ++ + # retrieve other data + my $infoclass = ($tree->look_down('class','info1'))[0]; + unless ($infoclass) { +- $info {$stocks,"success"} = 0; +- $info {$stocks,"errormsg"} = "$stocks retrieval not supported."; +- next ; +- }; ++ my $opcvm = ($tree->look_down('id','opcvm_headerFund_0'))[0]; ++ unless ($opcvm) { ++ $info {$stocks,"success"} = 0; ++ $info {$stocks,"errormsg"} = "$stocks retrieval not supported."; ++ next ; ++ } ++ ++ # the stock is a delayed OPCVM ++ ++ my $infoelem = ($tree->look_down('id','content-gauche'))[0]; ++ $infoelem = ($infoelem->look_down('class','TabContenu'))[0]; ++ ++ my @rows = $infoelem->look_down('_tag','tr'); ++ foreach my $i (0..$#rows) { ++ my $row = $rows[$i]; ++ unless($row->attr('class')) { ++ next; ++ } ++ ++ my @cells = $row->look_down('_tag','td'); ++ my $keytext = ($cells[0])->as_text; ++ my $valuetext = ($cells[2])->as_text; ++ ++ $tempinfo{$keytext} = $valuetext; ++ } ++ } ++ else { + + my $keys = ($infoclass->look_down('class','t01'))[0]; # this div contains all keys + my $data = ($infoclass->look_down('class','t03'))[0]; # this div contains all values + my @keys = $keys->look_down('_tag','li'); + my @values = $data->look_down('_tag','li'); + +- my %tempinfo; #holds table data +- + foreach my $i (0..$#keys) { + my $keytext = ($keys[$i])->as_text; + my $valuetext = ($values[$i])->as_text; + $tempinfo{$keytext} = $valuetext; + } + ++ } ++ + foreach my $key (keys %tempinfo) { + # print "$key -> $tempinfo{$key}\n"; + + ASSIGN: for ( $key ) { ++ # OPCVM ++ /Valeur liquidative/ && do { ++ my ($last, $currency) = ($tempinfo{$key} =~ m/(\d*.?\d*)\s*(\w*)/); ++ $info{$stocks,"last"} = $last; ++ $info{$stocks,"currency"} = $currency; ++ }; ++ /Date/ && do { ++ $info{$stocks,"date"} = $tempinfo{$key}; ++ $quoter->store_date(\%info, $stocks, {eurodate => $info{$stocks,"date"}}); ++ }; ++ /Variation Veille/ && do { ++ $info{$stocks,"p_change"}=$tempinfo{$key} ++ }; ++ # REGULAR STOCK + /Cours/ && do { + my ($last, $currency) = ($tempinfo{$key} =~ m/(\d*.?\d*)\(c\)\s*(\w*)/); + $info{$stocks,"last"} = $last; diff --git a/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-TSP.pm b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-TSP.pm new file mode 100644 index 000000000000..7148061bbce6 --- /dev/null +++ b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-TSP.pm @@ -0,0 +1,13 @@ +http://github.com/pfenwick/finance-quote/commit/97f8741c90af7c637c2fc990c4245c7e56eb3087 + +--- lib/Finance/Quote/TSP.pm.orig 2009-10-06 01:39:57.000000000 +0800 ++++ lib/Finance/Quote/TSP.pm 2010-11-05 19:26:46.000000000 +0800 +@@ -43,7 +43,7 @@ + + # URLs of where to obtain information + +-$TSP_URL = 'http://www.tsp.gov/rates/share-prices.html'; ++$TSP_URL = 'https://www.tsp.gov/investmentfunds/shareprice/sharePriceHistory.shtml'; + $TSP_MAIN_URL=("http://www.tsp.gov"); + + %TSP_FUND_COLUMNS = ( diff --git a/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Tiaacref.pm b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Tiaacref.pm new file mode 100644 index 000000000000..9237f8325213 --- /dev/null +++ b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote-Tiaacref.pm @@ -0,0 +1,74 @@ +http://github.com/pfenwick/finance-quote/commit/b897e9e2a328396480a7ef21fad2c94f8357baa6 + +--- lib/Finance/Quote/Tiaacref.pm.orig 2009-10-06 01:39:57.000000000 +0800 ++++ lib/Finance/Quote/Tiaacref.pm 2010-11-05 19:34:30.000000000 +0800 +@@ -44,7 +44,8 @@ + + # URLs of where to obtain information. + # This used to be different for the CREF and TIAA annuities, but this changed. +-$CREF_URL = ("https://www3.tiaa-cref.org/ddata/DownloadData?"); ++$CREF_URL = ("http://www.tiaa-cref.org/public/performance/retirement/data/results?"); ++#https://www3.tiaa-cref.org/ddata/DownloadData?"); + + sub methods { return (tiaacref=>\&tiaacref); } + +@@ -256,9 +257,21 @@ + my($ua,$urlc,$urlt); #useragent and target urls + my($cntc,$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 ($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()); ++ ++ $urlc = $CREF_URL; ++ $urlc .= "page=input"; ++ $urlc .= "&frommonth=" . ($Fmon + 1); ++ $urlc .= "&fromday=" . ($Fmday); ++ $urlc .= "&fromyear=" . ($Fyear + 1900); ++ $urlc .= "&tomonth=" . ($Tmon + 1); ++ $urlc .= "&today=" . ($Tmday); ++ $urlc .= "&toyear=" . ($Tyear + 1900); ++ $urlc .= "&sqlorder=desc&dldformat=1&submit.x=29&submit.y=7"; + +-# $url = $TIAACREF_URL; +- $urlc = $CREF_URL; + $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 +@@ -269,7 +282,8 @@ + if ($tiaacref_ids{$fund}) { + if ($tiaacref_locs{$fund} == 1) { + $cntc++; +- $urlc .= "f" . $cntc . "=" . $tiaacref_vals{$fund} . "&"; ++ $urlc .= "&fundid" . $tiaacref_vals{$fund} . "=" . $tiaacref_vals{$fund}; ++ $cbResult .= ($cntc > 1) ? ( "%2C" . $tiaacref_vals{$fund}) : ($tiaacref_vals{$fund}) + } else { + $urlt .= $fund . "=yes&"; + $cntt++; +@@ -280,8 +294,7 @@ + $info{$fund,"errormsg"} = "Bad symbol"; + } + } +- $urlc .= "days=1"; +- $urlc .= "&dldformat=1"; ++ $urlc .= "&$cbResult"; + $urlt .= "selected=1"; + $qdata =""; + +@@ -298,9 +311,14 @@ + $qdata .= $reply->content; + } + } ++ + if (length($qdata)) { +- foreach (split('\012',$qdata) ){ ++ foreach (split(/<br .>/,$qdata) ){ ++ next unless m/.+,.+/; ++ s/^ +//g; ++ s/ +$//g; + @line = $quoter->parse_csv($_); ++ + if (exists $check{$line[0]}) { #did we ask for this data? + $info{$line[0],"symbol"} = $line[0]; #in case the caller needs this in the hash + $info{$line[0],"exchange"} = "TIAA-CREF"; diff --git a/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote.pm b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote.pm new file mode 100644 index 000000000000..a20aa2cf5c3e --- /dev/null +++ b/finance/p5-Finance-Quote/files/patch-lib-Finance-Quote.pm @@ -0,0 +1,13 @@ +http://github.com/pfenwick/finance-quote/commit/7de984bea80e9c5e00504ededba6897183bb8c45 + +--- lib/Finance/Quote.pm.orig 2009-10-06 01:39:57.000000000 +0800 ++++ lib/Finance/Quote.pm 2010-02-13 18:25:22.000000000 +0800 +@@ -167,7 +167,7 @@ + if (!@reqmodules or $reqmodules[0] eq "-defaults") { + shift(@reqmodules) if (@reqmodules); + # Default modules +- @modules = qw/AEX AIAHK ASEGR ASX BMONesbittBurns Bourso Cdnfundlibrary ++ @modules = qw/AEX AIAHK ASEGR ASX BMONesbittBurns BSERO Bourso Cdnfundlibrary + Currencies Deka DWS FTPortfolios Fidelity FinanceCanada Fool HU + GoldMoney HEX + IndiaMutual LeRevenu ManInvestments Morningstar NZX Platinum SEB diff --git a/finance/p5-Finance-Quote/files/patch-t-bsero.t b/finance/p5-Finance-Quote/files/patch-t-bsero.t new file mode 100644 index 000000000000..fd3edfcf3dfc --- /dev/null +++ b/finance/p5-Finance-Quote/files/patch-t-bsero.t @@ -0,0 +1,50 @@ +http://github.com/pfenwick/finance-quote/commit/7de984bea80e9c5e00504ededba6897183bb8c45 + +--- t/bsero.t.orig 1970-01-01 08:00:00.000000000 +0800 ++++ t/bsero.t 2010-02-13 18:25:22.000000000 +0800 +@@ -0,0 +1,45 @@ ++#!/usr/bin/perl -w ++use strict; ++use Test; ++use Data::Dumper; ++BEGIN {plan tests => 26}; ++ ++use Finance::Quote; ++ ++# Test BSERO functions. ++ ++my $q = Finance::Quote->new(); ++my @stocks = ("TLV", "BRD", "SNP"); ++ ++my %regexps = ( ++ TLV => qr/\bTLV\b/, ++ BRD => qr/\bBRD\b/, ++ SNP => qr/\bSNP\b/, ++); ++ ++ ++my %quotes = $q->fetch("bsero", @stocks); ++ok(%quotes); ++ ++foreach my $stock (@stocks) { ++ ++ my $name = $quotes{$stock, "name"}; ++ print "#Testing $stock: $name\n"; ++ ++ my $regexp = $regexps{$stock}; ++ ok($name =~ /$regexp/i); ++ ++ ok($quotes{$stock, "exchange"} eq 'Bucharest Stock Exchange'); ++ ok($quotes{$stock, "method"} eq 'bsero'); ++ ++ ok($quotes{$stock, "last"} > 0); ++ ok($quotes{$stock, "open"} =~ /^-?\d+\.\d+$/); ++ ok($quotes{$stock, "p_change"} =~ /^-?\d+\.\d+$/); ++ ok($quotes{$stock, "success"}); ++ ok($quotes{$stock, "volume"} >= 0); ++} ++ ++ ++# Check that a bogus stock returns no-success. ++%quotes = $q->fetch("tsx", "BOGUS"); ++ok(! $quotes{"BOGUS","success"}); diff --git a/finance/p5-Finance-Quote/pkg-descr b/finance/p5-Finance-Quote/pkg-descr index a72cb7dba2a4..fb8cf9c01547 100644 --- a/finance/p5-Finance-Quote/pkg-descr +++ b/finance/p5-Finance-Quote/pkg-descr @@ -4,4 +4,6 @@ Exchange. There are two methods of using this module -- a functional interface that is depreciated, and an object-orientated method that provides greater flexibility and stability. +Github repository is at http://github.com/pfenwick/finance-quote/ + WWW: http://search.cpan.org/dist/Finance-Quote/ diff --git a/finance/p5-Finance-Quote/pkg-plist b/finance/p5-Finance-Quote/pkg-plist index 4cd875f4ac69..7ad99971b307 100644 --- a/finance/p5-Finance-Quote/pkg-plist +++ b/finance/p5-Finance-Quote/pkg-plist @@ -1,14 +1,14 @@ -%%SITE_PERL%%/%%PERL_ARCH%%/auto/Finance/Quote/.packlist %%SITE_PERL%%/Finance/Quote.pm %%SITE_PERL%%/Finance/Quote/AEX.pm %%SITE_PERL%%/Finance/Quote/AIAHK.pm %%SITE_PERL%%/Finance/Quote/ASEGR.pm %%SITE_PERL%%/Finance/Quote/ASX.pm %%SITE_PERL%%/Finance/Quote/BMONesbittBurns.pm +%%SITE_PERL%%/Finance/Quote/BSERO.pm %%SITE_PERL%%/Finance/Quote/Bourso.pm %%SITE_PERL%%/Finance/Quote/Cdnfundlibrary.pm -%%SITE_PERL%%/Finance/Quote/Currencies.pm %%SITE_PERL%%/Finance/Quote/Cominvest.pm +%%SITE_PERL%%/Finance/Quote/Currencies.pm %%SITE_PERL%%/Finance/Quote/DWS.pm %%SITE_PERL%%/Finance/Quote/Deka.pm %%SITE_PERL%%/Finance/Quote/FTPortfolios.pm @@ -18,6 +18,7 @@ %%SITE_PERL%%/Finance/Quote/Fool.pm %%SITE_PERL%%/Finance/Quote/GoldMoney.pm %%SITE_PERL%%/Finance/Quote/HEX.pm +%%SITE_PERL%%/Finance/Quote/HU.pm %%SITE_PERL%%/Finance/Quote/IndiaMutual.pm %%SITE_PERL%%/Finance/Quote/LeRevenu.pm %%SITE_PERL%%/Finance/Quote/ManInvestments.pm @@ -44,10 +45,10 @@ %%SITE_PERL%%/Finance/Quote/Yahoo/Europe.pm %%SITE_PERL%%/Finance/Quote/Yahoo/NZ.pm %%SITE_PERL%%/Finance/Quote/Yahoo/USA.pm -%%SITE_PERL%%/Finance/Quote/HU.pm %%SITE_PERL%%/Finance/Quote/ZA.pm +%%SITE_PERL%%/%%PERL_ARCH%%/auto/Finance/Quote/.packlist +@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Finance/Quote +@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Finance @dirrm %%SITE_PERL%%/Finance/Quote/Yahoo @dirrm %%SITE_PERL%%/Finance/Quote -@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Finance/Quote @dirrmtry %%SITE_PERL%%/Finance -@dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/Finance |