aboutsummaryrefslogtreecommitdiff
path: root/plugins/zyklonb/seen-import-degesch.pl
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-08-06 16:12:15 +0200
committerPřemysl Eric Janouch <p@janouch.name>2021-08-06 16:43:59 +0200
commit50057d5149dda340b3b47aca4096f4a6ec66b9ee (patch)
tree79323d20b17c2c8e32942a1ac9b84d9da3041c6d /plugins/zyklonb/seen-import-degesch.pl
parent1f64710e795b0c5434d15813d4f1f568467ca087 (diff)
downloadxK-50057d5149dda340b3b47aca4096f4a6ec66b9ee.tar.gz
xK-50057d5149dda340b3b47aca4096f4a6ec66b9ee.tar.xz
xK-50057d5149dda340b3b47aca4096f4a6ec66b9ee.zip
Come up with sillier names for the binaries
I'm not entirely sure, but it looks like some people might not like jokes about the Holocaust. On a more serious note, the project has become more serious over the 7 or so years of its existence.
Diffstat (limited to 'plugins/zyklonb/seen-import-degesch.pl')
-rwxr-xr-xplugins/zyklonb/seen-import-degesch.pl39
1 files changed, 0 insertions, 39 deletions
diff --git a/plugins/zyklonb/seen-import-degesch.pl b/plugins/zyklonb/seen-import-degesch.pl
deleted file mode 100755
index ddef6be..0000000
--- a/plugins/zyklonb/seen-import-degesch.pl
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/usr/bin/env perl
-# Creates a database for the "seen" plugin from logs for degesch.
-# The results may not be completely accurate but are good for jumpstarting.
-# Usage: ./seen-import-degesch.pl LOG-FILE... > seen.db
-
-use strict;
-use warnings;
-use File::Basename;
-use Time::Piece;
-
-my $db = {};
-for (@ARGV) {
- my $where = (basename($_) =~ /\.(.*).log/)[0];
- unless ($where) {
- print STDERR "Invalid filename: $_\n";
- next;
- }
-
- open my $fh, '<', $_ or die "Failed to open log file: $!";
- while (<$fh>) {
- my ($when, $who, $who_action, $what) =
- /^(.{19}) (?:<[~&@%+]*(.*?)>| \* (\S+)) (.*)/;
- next unless $when;
-
- if ($who_action) {
- $who = $who_action;
- $what = "* $what";
- }
- $db->{$who}->{$where} =
- [Time::Piece->strptime($when, "%Y-%m-%d %T")->epoch, $what];
- }
-}
-
-while (my ($who, $places) = each %$db) {
- while (my ($where, $data) = each %$places) {
- my ($when, $what) = @$data;
- print ":$who PRIVMSG $where $when :$what\n";
- }
-}