summaryrefslogtreecommitdiff
path: root/scripts/getquote
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-08-03 04:34:50 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:40:47 -0400
commita32173ace60df5a1e9414f5e95b556c436f62718 (patch)
treefff5b881c657fddb8543b0f787bfa75cf009a0b7 /scripts/getquote
parentcc98b59d1e99238270eb307b117da8b0b35e6f27 (diff)
downloadfork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.gz
fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.tar.bz2
fork-ledger-a32173ace60df5a1e9414f5e95b556c436f62718.zip
changes
Diffstat (limited to 'scripts/getquote')
-rw-r--r--[-rwxr-xr-x]scripts/getquote6
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/getquote b/scripts/getquote
index 8daf6633..cf8c8abd 100755..100644
--- a/scripts/getquote
+++ b/scripts/getquote
@@ -1,14 +1,16 @@
#!/usr/bin/perl
+exit 0 if $ARGV[0] eq "\$";
+
use Finance::Quote;
$q = Finance::Quote->new;
+
$q->timeout(60);
$q->require_labels(qw/price/);
%quotes = $q->fetch("nasdaq", $ARGV[0]);
+
if ($quotes{$ARGV[0], "price"}) {
print "\$", $quotes{$ARGV[0], "price"}, "\n";
-} else {
- exit 1;
}