summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-06-05 18:44:42 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-06-05 18:44:42 +0200
commit892605e6ec012bc8a7971691baf2405244bcdf9a (patch)
tree4b55fe7a1e09976bcbd33295142adad3c9ed6fce /bin
parent1ba1ca71b347fe7b9fc168e5a3e4eec4518af8d0 (diff)
Slight variable name cleanup
Diffstat (limited to 'bin')
-rwxr-xr-xbin/efa13
1 files changed, 5 insertions, 8 deletions
diff --git a/bin/efa b/bin/efa
index ea5724b..ed011e7 100755
--- a/bin/efa
+++ b/bin/efa
@@ -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());
}
}
}