diff options
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; |