Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[irclog] cleanup:

 * moved *.pm to lib/
 * added "use lib 'lib';" line to cgi scripts


git-svn-id: http://svn.pugscode.org/pugs/misc/irclog@18537 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit 36da55326115cd905412ce127bf6ef4bac2b524d 1 parent 634efd3
moritz authored
View
3  TODO
@@ -1,8 +1,9 @@
-* maybe add context to search results?
* links to colabti irclogs - but how to know for which channels?
+* fix context in search results for adjacent hits
Already done:
* import of colabti irclogs
+* add context to search results?
* full text search
15:29 < [particle]> if you're in the mood for adding more, processing
View
3  cgi/index.pl
@@ -7,9 +7,10 @@
use HTML::Entities;
use HTML::Template;
use Config::File;
+use HTML::Calendar::Simple;
+use lib 'lib';
use IrcLog qw(get_dbh);
use IrcLog::WWW qw(http_header);
-use HTML::Calendar::Simple;
my $conf = Config::File::read_config_file('cgi.conf');
my $base_url = $conf->{BASE_URL} || q{/};
View
5 cgi/out.pl
@@ -3,8 +3,6 @@
use strict;
use Carp qw(confess);
use CGI::Carp qw(fatalsToBrowser);
-use IrcLog qw(get_dbh gmt_today);
-use IrcLog::WWW qw(http_header message_line my_encode);
use Date::Simple qw(date);
use Encode::Guess;
use CGI;
@@ -12,6 +10,9 @@
use HTML::Template;
use Config::File;
use File::Slurp;
+use lib 'lib';
+use IrcLog qw(get_dbh gmt_today);
+use IrcLog::WWW qw(http_header message_line my_encode);
#use Data::Dumper;
View
5 cgi/search.pl
@@ -8,10 +8,11 @@
use Encode;
use HTML::Entities;
use HTML::Template;
-use IrcLog qw(get_dbh);
-use IrcLog::WWW qw(http_header message_line my_encode my_decode);
use Config::File;
use List::Util qw(min max);
+use lib 'lib';
+use IrcLog qw(get_dbh);
+use IrcLog::WWW qw(http_header message_line my_encode my_decode);
use utf8;
#use Data::Dumper;
#$DATA::Dumper::indent = 0;
View
5 cgi/spam.pl
@@ -4,12 +4,13 @@
use CGI::Carp qw(fatalsToBrowser);
use Carp qw(confess);
use lib '..';
-use IrcLog qw(get_dbh);
-use IrcLog::WWW 'http_header';
use CGI;
use Config::File;
use Data::Dumper;
use HTML::Template;
+use lib 'lib';
+use IrcLog qw(get_dbh);
+use IrcLog::WWW 'http_header';
my $q = CGI->new();
View
5 cgi/text.pl
@@ -3,13 +3,14 @@
use strict;
use Carp qw(confess);
use CGI::Carp qw(fatalsToBrowser);
-use IrcLog qw(get_dbh gmt_today);
-use IrcLog::WWW qw(my_encode);
use CGI;
use Encode;
use HTML::Entities;
# evil hack: Text::Table lies somewhere near /irclog/ on the server...
use lib '../lib';
+use lib 'lib';
+use IrcLog qw(get_dbh gmt_today);
+use IrcLog::WWW qw(my_encode);
use Text::Table;
my $default_channel = 'perl6';
View
9 ilbot2.pl
@@ -72,8 +72,8 @@ package IrcLogBot;
}
sub nick_change {
- my ($self, $e) = @_;
- print Dumper($e);
+ my $self = shift;
+ print Dumper(\@_);
# XXX TODO
return undef;
}
@@ -84,6 +84,11 @@ package IrcLogBot;
dbwrite($e->{channel}, "", $e->{nick} . ' was kicked by ' . $e->{who} . ': ' . $e->{reason});
return undef;
}
+
+ sub help {
+ my $self = shift;
+ return "This is a passive irc logging bot. Homepage: http://moritz.faui2k3.org/en/ilbot";
+ }
}
View
0  IrcLog.pm → lib/IrcLog.pm
File renamed without changes
View
10 IrcLog/WWW.pm → lib/IrcLog/WWW.pm
@@ -60,7 +60,7 @@ sub my_decode {
my @encodings = qw(ascii utf-8 iso-8859-15 gb2312);
my $encoder = guess_encoding($str, @encodings);
if (ref $encoder){
- return $encoder->decode($str);
+ return $encoder->decode($str);
} else {
return decode("utf-8", $str);
}
@@ -356,9 +356,9 @@ sub break_apart {
sub message_line {
- my ($args_ref, $c) = @_;
- my $nick = $args_ref->{nick};
- my $colors = $args_ref->{colors};
+ my ($args_ref, $c) = @_;
+ my $nick = $args_ref->{nick};
+ my $colors = $args_ref->{colors};
my %h = (
ID => $args_ref->{id},
TIME => format_time($args_ref->{timestamp}),
@@ -366,7 +366,7 @@ sub message_line {
LINE_NUMBER => ++$args_ref->{line_number},
LINK_URL => $args_ref->{link_url},
);
- $h{SEARCH_FOUND} = 'search_found' if ($args_ref->{search_found});
+ $h{SEARCH_FOUND} = 'search_found' if ($args_ref->{search_found});
my @classes;
my @msg_classes;
View
6 t/decode.t
@@ -3,8 +3,8 @@ use warnings;
use Encode qw(encode decode);
#use Smart::Comments;
-use Test::Base tests => 11;
-BEGIN { use_ok('IrcLog'); }
+use Test::Base tests => 10;
+use IrcLog::WWW qw(my_encode);
run {
my $block = shift;
@@ -14,7 +14,7 @@ run {
my $utf8 = decode('utf8', $str);
my $bytes = encode($enc, $utf8);
### $bytes
- my $got = IrcLog::my_encode($bytes);
+ my $got = my_encode($bytes);
is $got, $str, "$name - $enc";
}
};
Please sign in to comment.
Something went wrong with that request. Please try again.