summaryrefslogtreecommitdiff
path: root/contrib/scripts/getquote
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2008-08-05 13:17:04 -0400
committerJohn Wiegley <johnw@newartisans.com>2008-08-05 18:05:49 -0400
commitf6f4a46cf5b14f9a2170cd6475958efbf320caec (patch)
tree05bc1defcdebc201de3dd10477483d906a842821 /contrib/scripts/getquote
parentb7970b29855563e4c67f85af8b31233eda80c22a (diff)
downloadfork-ledger-f6f4a46cf5b14f9a2170cd6475958efbf320caec.tar.gz
fork-ledger-f6f4a46cf5b14f9a2170cd6475958efbf320caec.tar.bz2
fork-ledger-f6f4a46cf5b14f9a2170cd6475958efbf320caec.zip
Moved around most of the files so that source code is in src/, documentation
is in doc/, etc.
Diffstat (limited to 'contrib/scripts/getquote')
-rwxr-xr-xcontrib/scripts/getquote16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/scripts/getquote b/contrib/scripts/getquote
new file mode 100755
index 00000000..bed561d6
--- /dev/null
+++ b/contrib/scripts/getquote
@@ -0,0 +1,16 @@
+#!/usr/bin/perl
+
+$timeout = 60;
+
+use Finance::Quote;
+
+$q = Finance::Quote->new;
+$q->timeout($timeout);
+$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;
+}