7 use Onis::Config qw#get_config#;
8 use Onis::Data::Core qw#nick_rename store#;
9 use Onis::Parser::Persistent qw/set_absolute_time get_absolute_time add_relative_time get_state %MONTHNAMES @MONTHNUMS/;
11 @Onis::Parser::EXPORT_OK = qw/parse last_date/;
12 @Onis::Parser::ISA = ('Exporter');
16 if (get_config ('min_word_length'))
18 my $tmp = get_config ('min_word_length');
20 $WORD_LENGTH = $tmp if ($tmp);
23 my $VERSION = '$Id: Irssi.pm,v 1.4 2003/12/16 09:22:28 octo Exp $';
24 print STDERR $/, __FILE__, ": $VERSION" if ($::DEBUG);
31 # 2 == unable to parse
33 # 4 == don't have date
39 if ($line =~ m/^(\d\d):(\d\d) /)
41 add_relative_time ($1, $2);
43 elsif ($line =~ m/^--- /)
45 if ($line =~ m/(\w\w\w) (\d\d) (\d\d):(\d\d):(\d\d) (\d{4})/)
47 if (!defined ($MONTHNAMES{$1})) { return (4); }
48 set_absolute_time ($6, $MONTHNAMES{$1}, $2, $3, $4, $5);
52 $state = get_state ();
58 # 12:45 < impy> aufstand im forum..wurde niedergeschlagen
59 # 12:47 <@octo> mahlzeit :)
60 if ($line =~ m/^(\d\d):(\d\d) <(.)([^>]+)> (.+)/)
71 my @words = grep { length ($_) >= $WORD_LENGTH } (split (m/\W+/, $5));
72 $data->{'words'} = \@words;
77 # 12:48 * octo kommt grad vom einschreiben zurueck :)
78 # 00:20 * octo bricht grad voll ab vor lachen..
79 elsif ($line =~ m/^(\d\d):(\d\d) (\* (\S+) .+)$/)
90 my @words = grep { length ($_) >= $WORD_LENGTH } (split (m/\W+/, $3));
91 $data->{'words'} = \@words;
96 # 07:03 *** |Kodachi| [~kodachi@pD9505323.dip.t-dialin.net] has joined #schlegl
97 # 14:08 *** t_sunrise [t_sunrise@pD9E53413.dip.t-dialin.net] has joined #schlegl
98 elsif ($line =~ m/^(\d\d):(\d\d) ... (\S+) \[([^\]]+)\] has joined ([#!+&]\S+)/)
112 # 15:52 *** mode/#schlegl [+o martin-] by Sajdan
113 # 11:25 *** mode/#schlegl [+ooo Impy_ kyreon Sajdan] by octo
114 elsif ($line =~ m/^(\d\d):(\d\d) ... mode\/([#!+&]\S+) \[([^\]]+)\] by (\S+)/)
128 # 15:08 *** stoffi- is now known as foobar-
129 # 13:48 *** Lucky-17 is now known as Lucky17
130 elsif ($line =~ m/^(\d\d):(\d\d) ... (\S+) is now known as (\S+)/)
132 nick_rename ($1, $2);
135 # 14:00 *** kyreon changed the topic of #schlegl to: 100 Jahre Ball... kommt alle :)
136 # 15:03 *** martin- changed the topic of #schlegl to: http://martin.ipv6.cc/austellung.txt / Hat jmd Interesse?
137 elsif ($line =~ m/^(\d\d):(\d\d) ... (\S+) changed the topic of ([#!+&]\S+) to: (.+)/)
151 # 23:31 *** |Kodachi| [~kodachi@pD9505104.dip.t-dialin.net] has quit [sleepinf]
152 # 00:18 *** miracle- [~SandraNeu@pD9E531C9.dip.t-dialin.net] has quit [Ping timeout]
153 elsif ($line =~ m/^(\d\d):(\d\d) ... (\S+) \[([^\]]+)\] has quit \[([^\]]*)\]/)
167 # 15:08 *** t_sunrise [t_sunrise@p508472D6.dip.t-dialin.net] has left #schlegl [t_sunrise]
168 # 12:59 *** impy__ [impy@huhu.franken.de] has left #schlegl [impy__]
169 elsif ($line =~ m/^(\d\d):(\d\d) ... (\S+) \[([^\]]+)\] has left ([#!+&]\S+) \[([^\]]*)\]/)
184 # 21:54 *** stoffi- was kicked from #schlegl by martin- [bye]
185 # 12:37 *** miracle- was kicked from #schlegl by kyreon [kyreon]
186 elsif ($line =~ m/^(\d\d):(\d\d) ... (\S+) was kicked from ([#!+&]\S+) by (\S+) \[([^\]]+)\]/)
203 print STDERR $/, __FILE__, ": Not parsed: ``$line''" if ($::DEBUG & 0x20);
212 # $line =~ m/(\w\w\w) (\d\d) (\d\d):(\d\d):(\d\d) (\d{4})/
213 my $time = get_absolute_time ();
214 my ($sec, $min, $hour, $day, $month_num, $year) = (localtime ($time))[0 .. 5];
215 my $month_name = $MONTHNUMS[$month_num];
219 my $retval = sprintf ("%s %02u %02u:%02u:%02u %04u\n",
220 $month_name, $day, $hour, $min, $sec, $year);