blob: a462254e14b3023ff9c34552e57e6640d234c8cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/usr/bin/perl
use strict;
use warnings;
use CGI;
use HTTP::Headers;
use lib 'lib';
use IrcLog::WWW qw(http_header);
my $q = new CGI;
my $channel = $q->param('channel');
my $file = $q->param('file');
$file = "/srv/supybot/log/MeetBot/$channel/meetings/$file";
if (stat($file)) {
my $h = HTTP::Headers->new;
$h->header(Status => '200 OK',
'Content-Type' => "text/html; charset=utf-8",
'Content-Language' => 'en',
);
print $h->as_string . "\n";
open(FILE, $file);
print while <FILE>;
} else {
my $h = HTTP::Headers->new;
$h->header(Status => '404 Not Found',
'Content-Type' => "text/html; charset=utf-8",
'Content-Language' => 'en',
);
print $h->as_string . "\n";
}
|