Add Operating Systems post analysis and display

This commit is contained in:
Gregory Soutade
2015-01-08 20:59:11 +01:00
parent 9a1c23ec78
commit a40f116c71
5 changed files with 271 additions and 5 deletions

View File

@@ -1,9 +1,9 @@
#!/usr/bin/perl
my $awstats_lib_root = './';
my @awstats_libs = ('search_engines.pm', 'robots.pm');
my $awstats_lib_root = '/usr/share/awstats/lib/';
# my $awstats_lib_root = './';
my @awstats_libs = ('search_engines.pm', 'robots.pm', 'operating_systems.pm', 'browsers.pm');
# my $awstats_lib_root = '/usr/share/awstats/lib/';
# my @awstats_libs = ('browsers.pm', 'browsers_phone.pm', 'mime.pm', 'referer_spam.pm', 'search_engines.pm', 'operating_systems.pm', 'robots.pm', 'worms.pm');
foreach $lib (@awstats_libs) {require $awstats_lib_root . $lib;}
@@ -51,6 +51,8 @@ sub dumpHash {
# Robots
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, 0);
@@ -76,4 +78,28 @@ print $FIC "search_engines_knwown_url = {";
dumpHash(\%SearchEnginesKnownUrl, $FIC, 1);
print $FIC "}\n\n";
print $FIC "operating_systems = [";
dumpList(\@OSSearchIDOrder, $FIC, 1);
print $FIC "]\n\n";
print $FIC "operating_systems_hashid = {";
dumpHash(\%OSHashID, $FIC, 1);
print $FIC "}\n\n";
print $FIC "operating_systems_family = {";
dumpHash(\%OSFamily, $FIC, 1);
print $FIC "}\n\n";
print $FIC "browsers = [";
dumpList(\@BrowsersSearchIDOrder, $FIC, 1);
print $FIC "]\n\n";
print $FIC "browsers_hashid = {";
dumpHash(\%BrowsersHashIDLib, $FIC, 1);
print $FIC "}\n\n";
print $FIC "browsers_icons = {";
dumpHash(\%BrowsersHashIcon, $FIC, 1);
print $FIC "}\n\n";
close($FIC);