summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/IRIS.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2014-01-03 19:12:53 +0100
committerDaniel Friesel <derf@finalrewind.org>2014-01-03 19:12:53 +0100
commitbdfd43c81227c9e88c92ee145b5448463eeed276 (patch)
tree2d28607f36c75b1faa11516797bb05fa60b504db /lib/Travel/Status/DE/IRIS.pm
parent6a8f2dcb7938dc7883591eaec871878603be1839 (diff)
parse info and delay messages
Diffstat (limited to 'lib/Travel/Status/DE/IRIS.pm')
-rw-r--r--lib/Travel/Status/DE/IRIS.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Travel/Status/DE/IRIS.pm b/lib/Travel/Status/DE/IRIS.pm
index 5776452..7b326d2 100644
--- a/lib/Travel/Status/DE/IRIS.pm
+++ b/lib/Travel/Status/DE/IRIS.pm
@@ -150,6 +150,9 @@ sub get_realtime {
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 %messages;
my $result = first { $_->raw_id eq $id } $self->results;
@@ -159,6 +162,19 @@ sub get_realtime {
$result->add_realtime($s);
+ for my $e_m (@e_ms) {
+ my $type = $e_m->getAttribute('t');
+ my $value = $e_m->getAttribute('c');
+ my $id = $e_m->getAttribute('id');
+ my $ts = $e_m->getAttribute('ts');
+
+ if ($value) {
+ $messages{$id} = [ $ts, $type, $value ];
+ }
+ }
+
+ $result->add_messages(%messages);
+
if ($e_tl) {
$result->add_tl(
class => $e_tl->getAttribute('f'), # D N S F