Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/cgi/minutes.pl
blob: 3bdd52a8b90778960147c66f9d25a85fe0272e38 (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 = "/var/log/supybot/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";
}