Finance/Quote/Morningstarde.pm: generalize: lookup in id-mapping, and regard symbol as morningstar-ID otherwise

This commit is contained in:
Matthias Merz 2020-06-03 22:26:32 +02:00
parent 8a7bca09f3
commit 85e8f4905b

View File

@ -42,11 +42,14 @@ sub labels { return (morningstarde => \@labels); }
sub get_stock_url {
my $stock_wkn = shift;
my $stock_symbol = shift;
my $id = $idmap{lc($stock_wkn)};
# check ID-map for symbol, otherwise interpret as an ID
my $id = $idmap{lc($stock_symbol)};
if (defined($id)) {
return baseurl() . $id;
} else {
return baseurl() . $stock_symbol;
};
}