summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/IRIS.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Travel/Status/DE/IRIS.pm')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index aef946d..79852e7 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -192,11 +192,12 @@ sub get_realtime {
my $station = ( $xml->findnodes('/timetable') )[0]->getAttribute('station');
for my $s ( $xml->findnodes('/timetable/s') ) {
- my $id = $s->getAttribute('id');
- my $e_tl = ( $s->findnodes('./tl') )[0];
- my $e_ar = ( $s->findnodes('./ar') )[0];
- my $e_dp = ( $s->findnodes('./dp') )[0];
- my @e_ms = $s->findnodes('.//m');
+ my $id = $s->getAttribute('id');
+ my $e_tl = ( $s->findnodes('./tl') )[0];
+ my $e_ar = ( $s->findnodes('./ar') )[0];
+ my $e_dp = ( $s->findnodes('./dp') )[0];
+ my $e_ref = ( $s->findnodes('./ref') )[0];
+ my @e_ms = $s->findnodes('.//m');
my %messages;
@@ -234,6 +235,16 @@ sub get_realtime {
unknown_o => $e_tl->getAttribute('o'), # owner: 03/80/R2/...
);
}
+ if ($e_ref) {
+ $result->add_ref(
+ class => $e_ref->getAttribute('f'), # D N S F
+ unknown_t => $e_ref->getAttribute('t'), # p
+ train_no => $e_ref->getAttribute('n'), # dep number
+ type => $e_ref->getAttribute('c'), # S/ICE/ERB/...
+ line_no => $e_ref->getAttribute('l'), # 1 -> S1, ...
+ unknown_o => $e_ref->getAttribute('o'), # owner: 03/80/R2/...
+ );
+ }
if ($e_ar) {
$result->add_ar(
arrival_ts => $e_ar->getAttribute('ct'),