[31326] trunk/dports/perl/p5-finance-quote
ryandesign at macports.org
ryandesign at macports.org
Mon Nov 19 20:50:17 PST 2007
Revision: 31326
http://trac.macosforge.org/projects/macports/changeset/31326
Author: ryandesign at macports.org
Date: 2007-11-19 20:50:16 -0800 (Mon, 19 Nov 2007)
Log Message:
-----------
p5-finance-quote: fix inability to fetch quotes because TIAA-CREF changed how their server works
Modified Paths:
--------------
trunk/dports/perl/p5-finance-quote/Portfile
Added Paths:
-----------
trunk/dports/perl/p5-finance-quote/files/
trunk/dports/perl/p5-finance-quote/files/patch-Tiaacref.diff
Modified: trunk/dports/perl/p5-finance-quote/Portfile
===================================================================
--- trunk/dports/perl/p5-finance-quote/Portfile 2007-11-20 04:43:34 UTC (rev 31325)
+++ trunk/dports/perl/p5-finance-quote/Portfile 2007-11-20 04:50:16 UTC (rev 31326)
@@ -1,8 +1,10 @@
# $Id$
+
PortSystem 1.0
PortGroup perl5 1.0
+
perl5.setup Finance-Quote 1.13
-revision 0
+revision 1
categories perl
maintainers mas openmaintainer
description Perl module that allows for grabbing stock quotes.
@@ -15,6 +17,10 @@
checksums md5 3619ccb3fb09ed9eebe1941e6cf361c9
+# Fix this bug:
+# http://sourceforge.net/tracker/index.php?func=detail&aid=1821738&group_id=4232&atid=104232
+patchfiles patch-Tiaacref.diff
+
depends_lib-append \
port:p5-libwww-perl \
port:p5-html-tableextract \
Added: trunk/dports/perl/p5-finance-quote/files/patch-Tiaacref.diff
===================================================================
--- trunk/dports/perl/p5-finance-quote/files/patch-Tiaacref.diff (rev 0)
+++ trunk/dports/perl/p5-finance-quote/files/patch-Tiaacref.diff 2007-11-20 04:50:16 UTC (rev 31326)
@@ -0,0 +1,49 @@
+--- lib/Finance/Quote/Tiaacref.pm 2006-04-08 15:25:39.000000000 -0400
++++ lib/Finance/Quote/Tiaacref.pm 2007-11-19 22:47:12.000000000 -0500
+@@ -44,7 +44,7 @@
+
+ # 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 = ("https://www3.tiaa-cref.org/ddata/DownloadData");
+
+ sub methods { return (tiaacref=>\&tiaacref); }
+
+@@ -256,10 +256,12 @@
+ 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(@postc); #holds post vars
+
+ # $url = $TIAACREF_URL;
+ $urlc = $CREF_URL;
+ $urlt = $TIAA_URL;
++ @postc = ();
+ #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.
+@@ -269,7 +271,7 @@
+ if ($tiaacref_ids{$fund}) {
+ if ($tiaacref_locs{$fund} == 1) {
+ $cntc++;
+- $urlc .= "f" . $cntc . "=" . $tiaacref_vals{$fund} . "&";
++ push(@postc, "f" . $cntc => $tiaacref_vals{$fund});
+ } else {
+ $urlt .= $fund . "=yes&";
+ $cntt++;
+@@ -280,13 +282,13 @@
+ $info{$fund,"errormsg"} = "Bad symbol";
+ }
+ }
+- $urlc .= "days=1";
++ push(@postc, days => '1', dldformat => '1');
+ $urlt .= "selected=1";
+ $qdata ="";
+
+ $ua = $quoter->user_agent;
+ if ($cntc) {
+- $reply = $ua->request(GET $urlc);
++ $reply = $ua->request(POST $urlc, [@postc]);
+ if ($reply ->is_success) {
+ $qdata .= $reply->content;
+ }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20071119/88d792d9/attachment.html
More information about the macports-changes
mailing list