From 440124eacc9f7fde993e87968ca9e65ffa309f11 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Wed, 24 Jun 2009 02:44:07 +0100 Subject: 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. --- contrib/getquote.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'contrib/getquote.pl') 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; -- cgit v1.2.3