From 2b0f4b4a60c7f70092b230256cc6376268864798 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sat, 7 Mar 2009 14:39:06 +0100 Subject: Ignore all unknown information --- bin/efa | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bin/efa b/bin/efa index fe5ab6e..d9bc5ed 100755 --- a/bin/efa +++ b/bin/efa @@ -64,12 +64,7 @@ foreach(split(/ \d+\. Fahrt<\/span>/, $content)) { } foreach(split(/\n/)) { if (/(?[^<]+)<\/span>/) { - # Ignore "ca. 3 Minuten" and similar - # something like /^ca\. \d+ Minute/ does not work here, for some reason - # (probably related to encoding fuckup) - if ($+{content} !~ /^ca.*Minute/) { - push(@{$raw->[$offer-1]}, $+{content}); - } + push(@{$raw->[$offer-1]}, $+{content}); } } $offer++; @@ -92,9 +87,10 @@ if ($debug) { for ($offer = 0; exists($raw->[$offer]); $offer++) { for ($i = 0; @{$raw->[$offer]} >= (($i+1) * $groupsize); $i++) { $offset = $i * $groupsize; - # skip "Fußweg: x Minuten" messages (they're smaller than $groupsize) - if ($raw->[$offer]->[$offset+2] =~ /ca.*Minute/) { - splice(@$_, $offset, 5); + # If the first field is not a time we've got some additional information. + # Sadly, this script does not parse it yet, so it's ignored + until ($raw->[$offer]->[$offset] =~ /^\d+:\d+$/) { + splice(@{$raw->[$offer]}, $offset, 1) or last; } $cons->[$offer]->[$i] = { deptime => $raw->[$offer]->[$offset], -- cgit v1.2.3