summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-25 02:51:55 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-25 02:51:55 -0400
commit3a3227298dcd4faabd93e6f4bcaede10f29b13fd (patch)
treee618bb410b1d25db8c05acafc0023e304d5156e6 /scripts
parentfbad0421789856debcacf4d7138e39b08908a077 (diff)
downloadfork-ledger-3a3227298dcd4faabd93e6f4bcaede10f29b13fd.tar.gz
fork-ledger-3a3227298dcd4faabd93e6f4bcaede10f29b13fd.tar.bz2
fork-ledger-3a3227298dcd4faabd93e6f4bcaede10f29b13fd.zip
if a commodity price cannot be downloaded, report it as an error
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/getquote6
1 files changed, 2 insertions, 4 deletions
diff --git a/scripts/getquote b/scripts/getquote
index cf8c8abd..8daf6633 100755
--- a/scripts/getquote
+++ b/scripts/getquote
@@ -1,16 +1,14 @@
#!/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;
}