add testcode

This commit is contained in:
Matthias Merz 2018-06-09 13:05:44 +02:00
parent e8559dd6d4
commit 40472fd8bc

29
test.pl Normal file
View File

@ -0,0 +1,29 @@
#!/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";