summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/IRIS.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-02-14 22:59:22 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-02-14 22:59:22 +0100
commit56685ea830077964eaa5fc083d2b0cd17bb90aa5 (patch)
tree25f9cc25a7db8ffacf0a976e6a9fa60faf236de0 /lib/Travel/Status/DE/IRIS.pm
parent155ddeee707fe31f52e8c54b92476d746f30ea9e (diff)
parse <ref> fields in fchg. not used in db-iris yet.
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'),