mirror of https://github.com/Gnucash/gnucash
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
500 B
27 lines
500 B
#!/usr/bin/perl -w
|
|
use strict;
|
|
use lib '../lib';
|
|
use Finance::Quote;
|
|
use Data::Dumper;
|
|
use Getopt::Std;
|
|
|
|
# A very very simple script. Takes a source and a symbol, looks it up,
|
|
# and dumps it to STDOUT. Useful for debugging.
|
|
|
|
my %options = ('c' => '');
|
|
|
|
getopts('c:',\%options);
|
|
|
|
die "Usage: $0 [-c currency] source symbol\n" unless (defined $ARGV[1]);
|
|
|
|
my $q = Finance::Quote->new;
|
|
|
|
if ($options{'c'}) {
|
|
$q->set_currency($options{'c'});
|
|
}
|
|
|
|
my %quotes = $q->fetch(@ARGV);
|
|
|
|
print Dumper(\%quotes);
|
|
|