diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-05 18:44:42 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-06-05 18:44:42 +0200 |
commit | 892605e6ec012bc8a7971691baf2405244bcdf9a (patch) | |
tree | 4b55fe7a1e09976bcbd33295142adad3c9ed6fce /bin | |
parent | 1ba1ca71b347fe7b9fc168e5a3e4eec4518af8d0 (diff) |
Slight variable name cleanup
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/efa | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -26,8 +26,6 @@ my ($from_type, $to_type, $via_type) = ('stop') x 3; my $ignore_info = 'Fahrradmitnahme'; my ($test_dump, $test_parse); -my $xp_ambiguous = '//select'; - sub opt_time_arr { $post{itdTripDateTimeDepArr} = 'arr'; opt_time(@_); @@ -229,8 +227,8 @@ if ($test_dump) { my $tree = HTML::TreeBuilder::XPath->new_from_content($content); -if ($tree->exists($xp_ambiguous)) { - foreach my $select (@{$tree->findnodes($xp_ambiguous)}) { +if ($tree->exists('//select')) { + foreach my $select (@{$tree->findnodes('//select')}) { printf( "Ambiguous input: %s\n", $select->attr('name'), @@ -242,9 +240,8 @@ if ($tree->exists($xp_ambiguous)) { exit 1; } -my @chunk; my $con_part = 0; -my $no = 0; +my $con_no = 0; my $connections; foreach my $row (@{$tree->findnodes('//table//table/tr')}) { @@ -255,7 +252,7 @@ foreach my $row (@{$tree->findnodes('//table//table/tr')}) { { if (defined $_->attr('colspan') and $_->attr('colspan') == 8) { if ($_->as_text() =~ / (?<no> \d+ ) \. .+ Fahrt /x) { - $no = $+{'no'} - 1; + $con_no = $+{'no'} - 1; $con_part = 0; next; } @@ -269,7 +266,7 @@ foreach my $row (@{$tree->findnodes('//table//table/tr')}) { } } if (not $_->exists('./img') and $_->as_text() !~ /^\s*$/) { - push(@{$connections->[$no]->[$con_part]}, $_->as_text()); + push(@{$connections->[$con_no]->[$con_part]}, $_->as_text()); } } } |