Blob


1 #!/usr/bin/perl
2 #
4 use strict;
5 use warnings;
7 use lib qw(./lib);
8 use IRCNOW::Database;
9 use IRCNOW::ParseLog::Znc;
10 use IRCNOW::IO qw(:DEBUG);
11 $verbosity=INFO;
12 my $dbase='/var/www/botnow/botnow.db';
13 debug(INFO, "Loading Database $dbase");
14 my $botnowDB = IRCNOW::Database->new(dbpath=>$dbase);
16 my $znclog = IRCNOW::ParseLog::Znc->new(
17 database=>$botnowDB,
18 zncLog=>'/home/znc/home/znc/.znc/moddata/adminlog/znc.log',
19 );
21 use Data::Dumper;
23 my $lastRecord=$znclog->dbLastRecord() || [];
24 my $data = $znclog->parseLog($lastRecord->[1],$lastRecord->[3],$lastRecord->[4]);
25 debug (WARNINGS, "znclog: New entries to insert: \n" . Dumper($data));
27 if (@$data) {
28 $znclog->dbInsertRecord($data);
29 }
32 #print Dumper($znclog->parseLog($lastRecord->[1],$lastRecord->[3],$lastRecord->[4]));
34 #$znclog->createTable();