summaryrefslogtreecommitdiff
path: root/scripts/getquote
diff options
context:
space:
mode:
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;
}