Commit 2b0f4b4a authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

Ignore all unknown information

parent bb3478e6
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -64,14 +64,9 @@ 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});
		}
	}
	}
	$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],