finance-quote/test.pl
2018-06-09 13:05:48 +02:00

30 lines
470 B
Perl

#!/usr/bin/perl -w
use Finance::Quote;
my @papers;
if (@ARGV) {
@papers = @ARGV;
} else {
# example values
@papers = ("A0M9A2", "DE0005326565");
}
my $q = Finance::Quote->new("DKB");
my %retvals = $q->fetch("dkb",@papers);
#my @details = $q->labels();
my @details = ('name', 'price', 'currency', 'date');
foreach my $fund (@papers) {
foreach my $detail (@details) {
print "got $detail with value $retvals{$fund, $detail}\n";
}
print "\n";
}
print "\n";