diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-07 14:39:06 +0100 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2009-03-07 14:39:06 +0100 |
commit | 2b0f4b4a60c7f70092b230256cc6376268864798 (patch) | |
tree | 9baac7a70c7a2fcc39a2cd8020961165c5579240 /bin | |
parent | bb3478e623b84a9c0fd5f346fdf8f84168557c18 (diff) |
Ignore all unknown information
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/efa | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -64,12 +64,7 @@ foreach(split(/<span class="labelTextBold"> \d+\. Fahrt<\/span>/, $content)) { } foreach(split(/\n/)) { if (/<span class="labelText">(?<content>[^<]+)<\/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], |