#!/usr/bin/env perl
$| = 1;
our
$cgi
= new CGI;
print
$cgi
->header();
our
$dir
=
'./'
;
sub
footer {
open
my
$template
,
"<"
,
"footer.template.html"
;
print
join
''
, <
$template
>;
close
$template
;
}
open
my
$template
,
"<"
,
"header.template.html"
;
print
join
''
, <
$template
>;
close
$template
;
open
my
$dialog_file
,
"<"
,
"dialog.txt"
;
my
@dialog_lines
=
grep
{ /\t.*?\t/ }
<
$dialog_file
>;
foreach
(
@dialog_lines
) {
s/[;]+[-]*[)]+/<img src=
"wink.png"
\/>/igm;
s/[:]+[-]*[)]+/<img src=
"grin.png"
\/>/igm;
}
my
%ip_to_dialog
= ();
foreach
my
$line
(
@dialog_lines
) {
chomp
$line
;
$line
=~ s/[:]+/:/igm;
my
(
$datum
,
$ip
,
$talk
) =
split
/\t/,
$line
;
$datum
=~ s/.*?\s+//i;
$talk
=~ s/Mensch[:]/Mensch: /igm;
if
( !
$ip_to_dialog
{
$ip
} ) {
$ip_to_dialog
{
$ip
} = [];
}
push
@{
$ip_to_dialog
{
$ip
} },
$datum
.
"\t"
.
$talk
;
}
print
<<
"EOT"
;
<p>
<a href=
"jeliza-log.pl"
>Auswahl: Datum</a>
</p>
EOT
my
%dates_ip
= ();
foreach
my
$ip
(
keys
%ip_to_dialog
) {
my
$date
= (
split
/\t/, (@{
$ip_to_dialog
{
$ip
} }[0]))[0];
$dates_ip
{
$date
} =
$ip
;
}
my
@dates_sorted
=
sort
keys
%dates_ip
;
foreach
my
$date
(
@dates_sorted
) {
my
$ip
=
$dates_ip
{
$date
};
print
"<h2>"
.
$date
.
" - "
.
$ip
.
"</h2>\n"
;
print
"<pre>"
;
print
join
'<br />'
, @{
$ip_to_dialog
{
$ip
} };
print
"</pre>\n\n"
;
}
close
$dialog_file
;
my
$statement
= <<
"EOT"
;
<p style=
"color: black !important; font-size: 10pt !important; line-height: 28px; margin: 15px !important; background-color: #ffca9b !important; padding: 10px !important; margin-right: 300px !important;"
>
Wir bitten um seri
ö
;se Gespr
ä
;che mit JEliza; <br />
JEliza ist ein ernst gemeintes Projekt zur Entwicklung eines Gespr
ä
;chssimulators. <br />
Daher bittet das JEliza Team ausdr
ü
;cklich darum, an Beleidigungen und vulg
ä
;ren Ausdr
ü
;cken zu sparen.
</p>
EOT
print
footer();
exit
(0);
1;