summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DeutscheBahn.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2011-09-02 19:23:56 +0200
committerDaniel Friesel <derf@finalrewind.org>2011-09-02 19:23:56 +0200
commitca37cdd0009298b677ffbc356741098d609c474d (patch)
tree78b5f08a5947232e4e76e55c128d3ec6a295d403 /lib/Travel/Status/DE/DeutscheBahn.pm
parent40a308971dd32d9b7468ae3c2ef313e636f888e9 (diff)
DeutscheBahn/Result.pm: Add route_timetable accessor
Diffstat (limited to 'lib/Travel/Status/DE/DeutscheBahn.pm')
-rw-r--r--lib/Travel/Status/DE/DeutscheBahn.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/Travel/Status/DE/DeutscheBahn.pm b/lib/Travel/Status/DE/DeutscheBahn.pm
index 9cda933..46b679e 100644
--- a/lib/Travel/Status/DE/DeutscheBahn.pm
+++ b/lib/Travel/Status/DE/DeutscheBahn.pm
@@ -117,8 +117,8 @@ sub results {
my $xp_info = XML::LibXML::XPathExpression->new('./td[@class="ris"]');
my $re_via = qr{
- ^ \s* (.+?) \s* \n
- \d{1,2}:\d{1,2}
+ ^ \s* (?<stop> .+? ) \s* \n
+ (?<time> \d{1,2}:\d{1,2} )
}mx;
if ( defined $self->{results} ) {
@@ -164,13 +164,12 @@ sub results {
$first = 0;
next;
}
- my $stop = $1;
- if ( $stop =~ m{ [(] Halt \s entf.llt [)] }ox ) {
+ if ( $+{stop} =~ m{ [(] Halt \s entf.llt [)] }ox ) {
next;
}
- push( @via, $stop );
+ push( @via, [ $+{time}, $+{stop} ] );
}
push(