diff options
author | John Wiegley <johnw@newartisans.com> | 2009-06-24 02:44:07 +0100 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-06-24 02:44:07 +0100 |
commit | 440124eacc9f7fde993e87968ca9e65ffa309f11 (patch) | |
tree | c86839186bee5c4951ad98491d02625e9c276669 /contrib/getquote.pl | |
parent | 72a2eaa38e68b886a567da2afda8f08b1929e3b6 (diff) | |
download | fork-ledger-440124eacc9f7fde993e87968ca9e65ffa309f11.tar.gz fork-ledger-440124eacc9f7fde993e87968ca9e65ffa309f11.tar.bz2 fork-ledger-440124eacc9f7fde993e87968ca9e65ffa309f11.zip |
Restored --download, although not done yet
The problem at this point is that it's recording prices in the price
database multiple times; it should only need to download a price for
each commodity once per day.
Diffstat (limited to 'contrib/getquote.pl')
-rwxr-xr-x | contrib/getquote.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/getquote.pl b/contrib/getquote.pl index bed561d6..8e3bb678 100755 --- a/contrib/getquote.pl +++ b/contrib/getquote.pl @@ -1,8 +1,9 @@ -#!/usr/bin/perl +#!/usr/bin/env perl $timeout = 60; use Finance::Quote; +use POSIX qw(strftime localtime time); $q = Finance::Quote->new; $q->timeout($timeout); @@ -10,6 +11,8 @@ $q->require_labels(qw/price/); %quotes = $q->fetch("nasdaq", $ARGV[0]); if ($quotes{$ARGV[0], "price"}) { + print strftime('%Y/%m/%d %H:%M:%S', localtime(time())); + print " ", $ARGV[0], " "; print "\$", $quotes{$ARGV[0], "price"}, "\n"; } else { exit 1; |