Remove .*bot.* and .*crawl.* from awstats_data

This commit is contained in:
Gregory Soutade 2023-03-11 20:56:18 +01:00
parent adc04bf753
commit 44c76007cd
2 changed files with 33 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -30,6 +30,29 @@ sub dumpList {
}
}
sub dumpRobotList {
my @list = @{$_[0]};
my $FIC = $_[1];
my $first = $_[2];
foreach $r (@list)
{
next if ($r =~ /.*[Bb]ot.*/);
next if ($r =~ /.*[Cc]rawl.*/);
$r =~ s/\'/\\\'/g;
if ($first == 0)
{
print $FIC ", ";
}
else
{
$first = 0;
}
print $FIC "'$r'";
}
}
sub dumpHash {
my %hash = %{$_[0]};
my $FIC = $_[1];
@ -57,8 +80,8 @@ open($FIC,">", "awstats_data.py") or die $!;
print $FIC "#This file was automatically generated by iwla_convert.pl. Do not edit manually.\n\n";
print $FIC "robots = [";
dumpList(\@RobotsSearchIDOrder_list1, $FIC, 1);
dumpList(\@RobotsSearchIDOrder_list2, $FIC, (@RobotsSearchIDOrder_list1 == 0) ? 1 : 0);
dumpRobotList(\@RobotsSearchIDOrder_list1, $FIC, 1);
dumpRobotList(\@RobotsSearchIDOrder_list2, $FIC, (@RobotsSearchIDOrder_list1 == 0) ? 1 : 0);
print $FIC "]\n\n";
print $FIC "search_engines = [";