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