Finance/Quote/DKB.pm: update URLS and Parsing
This commit is contained in:
parent
40472fd8bc
commit
319fa34f8d
@ -23,18 +23,18 @@ use HTML::TreeBuilder::XPath;
|
|||||||
my $agent_string = 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0';
|
my $agent_string = 'Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0';
|
||||||
|
|
||||||
my %urlmap_wkn = (
|
my %urlmap_wkn = (
|
||||||
'532656' => 'https://dkb.mdgms.com/MIS/?id_instrument=4071891&id=0107980&pid=DKB_fnd_profile&id_notation=3688058',
|
'532656' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=4071891&id_notation=3688058&id=0107980',
|
||||||
'974515' => 'https://dkb.mdgms.com/MIS/?id_instrument=102918&id=0107980&pid=DKB_fnd_profile&id_notation=3228063',
|
'974515' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=102918&id_notation=3228063&id=0107980',
|
||||||
'a0dpw0' => 'https://dkb.mdgms.com/MIS/?id_instrument=11659733&id=0107980&pid=DKB_fnd_profile&id_notation=11014630',
|
'a0dpw0' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=11659733&id_notation=11014630&id=0107980',
|
||||||
'a0m430' => 'https://dkb.mdgms.com/MIS/?id_instrument=18085585&id=0107980&pid=DKB_fnd_profile&id_notation=20644387',
|
'a0m430' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=18085585&id_notation=20644387&id=0107980',
|
||||||
'a0m8hd' => 'https://dkb.mdgms.com/MIS/?id_instrument=19179789&id=0107980&pid=DKB_fnd_profile&id_notation=21240603',
|
'a0m8hd' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=19179789&id_notation=21240603&id=0107980',
|
||||||
'a0m9a2' => 'https://dkb.mdgms.com/MIS/?id_instrument=19035880&id=0107980&pid=DKB_fnd_profile&id_notation=23679474',
|
'a0m9a2' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=19035880&id_notation=23679474&id=0107980',
|
||||||
'a0ndda' => 'https://dkb.mdgms.com/MIS/?id_instrument=25204090&id=0107980&pid=DKB_fnd_profile&id_notation=31156472',
|
'a0ndda' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=25204090&id_notation=31156472&id=0107980',
|
||||||
'a0x754' => 'https://dkb.mdgms.com/MIS/?id_instrument=22407622&id=0107980&pid=DKB_fnd_profile&id_notation=26567264',
|
'a0x754' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=22407622&id_notation=26567264&id=0107980',
|
||||||
'a0x758' => 'https://dkb.mdgms.com/MIS/?id_instrument=22533730&id=0107980&pid=DKB_fnd_profile&id_notation=26567263',
|
'a0x758' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=22533730&id_notation=26567263&id=0107980',
|
||||||
'a0ya5q' => 'https://dkb.mdgms.com/MIS/?id_instrument=26097198&id=0107980&pid=DKB_fnd_profile&id_notation=32652184',
|
'a0ya5q' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=26097198&id_notation=32652184&id=0107980',
|
||||||
'dws0pr' => 'https://dkb.mdgms.com/MIS/?id_instrument=18286450&id=0107980&pid=DKB_fnd_profile&id_notation=22946309',
|
'dws0pr' => 'https://kurse.dkb.de/MIS/?pid=dkb_fnd_details&id_instrument=18286450&id_notation=22946309&id=0107980',
|
||||||
'ewg0ld' => 'https://dkb.mdgms.com/MIS/?pid=DKB_cer_portrait&id_instrument=55061564&id_notation=70580062&id=0107980'
|
'ewg0ld' => 'https://kurse.dkb.de/MIS/?pid=dkb_cer_details&id_instrument=55061564&id_notation=70580062&id=0107980'
|
||||||
);
|
);
|
||||||
|
|
||||||
my %wknmap = (
|
my %wknmap = (
|
||||||
@ -97,11 +97,11 @@ sub dkb
|
|||||||
$info{$stock,'symbol'} = $stock;
|
$info{$stock,'symbol'} = $stock;
|
||||||
my $parser = HTML::TreeBuilder::XPath->new_from_content($response->decoded_content);
|
my $parser = HTML::TreeBuilder::XPath->new_from_content($response->decoded_content);
|
||||||
|
|
||||||
my @names = $parser->findnodes( '//span[@class="dkbPortraitName"]');
|
my @names = $parser->findnodes( '//span[@class="h2"]');
|
||||||
if (@names) {
|
if (@names) {
|
||||||
$info{$stock,'name'} = $names[0]->as_text;
|
$info{$stock,'name'} = $names[0]->as_text;
|
||||||
};
|
};
|
||||||
my @prices = $parser->findnodes( '//span[@class="dkbPortraitPrice"]');
|
my @prices = $parser->findnodes( '//span[@class="quote"]');
|
||||||
if (@prices) {
|
if (@prices) {
|
||||||
my $pricestr = $prices[0]->as_text;
|
my $pricestr = $prices[0]->as_text;
|
||||||
my @splitvals = ( $pricestr =~ /((\d|,|\.)*)\s*/g);
|
my @splitvals = ( $pricestr =~ /((\d|,|\.)*)\s*/g);
|
||||||
@ -111,16 +111,17 @@ sub dkb
|
|||||||
$converted_price =~ s/,/./g;
|
$converted_price =~ s/,/./g;
|
||||||
$info{$stock,'price'} = $converted_price;
|
$info{$stock,'price'} = $converted_price;
|
||||||
$info{$stock,'last'} = $converted_price;
|
$info{$stock,'last'} = $converted_price;
|
||||||
if ($pricestr =~ /EUR/) {
|
|
||||||
$info{$stock,'currency'} = 'EUR';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
my @dates = $parser->findnodes( '//span[@class="dkbPortraitDate"]');
|
my @units = $parser->findnodes( '//span[@class="unit"]');
|
||||||
if (@dates) {
|
if (@units) {
|
||||||
#$info{$stock,'date'} = $dates[0]->as_text;
|
$info{$stock,'currency'} = $units[0]->as_text;
|
||||||
$quoter->store_date(\%info, $stock, {eurodate => $dates[0]->as_text});
|
|
||||||
};
|
};
|
||||||
|
#my @dates = $parser->findnodes( '//span[@class="dkbPortraitDate"]');
|
||||||
|
#if (@dates) {
|
||||||
|
# #$info{$stock,'date'} = $dates[0]->as_text;
|
||||||
|
# $quoter->store_date(\%info, $stock, {eurodate => $dates[0]->as_text});
|
||||||
|
#};
|
||||||
$info{$stock,'timezone'} = 'Europe/Berlin';
|
$info{$stock,'timezone'} = 'Europe/Berlin';
|
||||||
#$info{$stock,'currency'} = 'EUR';
|
#$info{$stock,'currency'} = 'EUR';
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user