summaryrefslogtreecommitdiff
path: root/lib/Travel/Status/DE/DeutscheBahn.pm
diff options
context:
space:
mode:
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(