Permalink
Browse files

Add ilbot2 to repository. Thanks perl guys

  • Loading branch information...
1 parent c25f4af commit ff0c4816457ad06c2c4e587292e44923c112350b @cschneid committed Jan 4, 2011
Showing with 5,182 additions and 0 deletions.
  1. +67 −0 bot/IrcLog.pm
  2. +5 −0 bot/README
  3. +18 −0 bot/TODO
  4. +1 −0 bot/add_id.sql
  5. +7 −0 bot/bot.conf
  6. +25 −0 bot/cgi/.htaccess
  7. +89 −0 bot/cgi/.svn/all-wcprops
  8. +211 −0 bot/cgi/.svn/entries
  9. +1 −0 bot/cgi/.svn/format
  10. +5 −0 bot/cgi/.svn/prop-base/at.png.svn-base
  11. +5 −0 bot/cgi/.svn/prop-base/channel-index.pl.svn-base
  12. +5 −0 bot/cgi/.svn/prop-base/index.pl.svn-base
  13. +5 −0 bot/cgi/.svn/prop-base/moose1.ico.svn-base
  14. +5 −0 bot/cgi/.svn/prop-base/moosecamel.png.svn-base
  15. +5 −0 bot/cgi/.svn/prop-base/out.pl.svn-base
  16. +5 −0 bot/cgi/.svn/prop-base/search.pl.svn-base
  17. +5 −0 bot/cgi/.svn/prop-base/spam.pl.svn-base
  18. +5 −0 bot/cgi/.svn/prop-base/text.pl.svn-base
  19. +25 −0 bot/cgi/.svn/text-base/.htaccess.svn-base
  20. +174 −0 bot/cgi/.svn/text-base/abbr.dat.svn-base
  21. BIN bot/cgi/.svn/text-base/at.png.svn-base
  22. +1 −0 bot/cgi/.svn/text-base/cgi.conf.svn-base
  23. +97 −0 bot/cgi/.svn/text-base/channel-index.pl.svn-base
  24. +54 −0 bot/cgi/.svn/text-base/index.pl.svn-base
  25. +6 −0 bot/cgi/.svn/text-base/links.dat.svn-base
  26. BIN bot/cgi/.svn/text-base/moose1.ico.svn-base
  27. BIN bot/cgi/.svn/text-base/moosecamel.png.svn-base
  28. +211 −0 bot/cgi/.svn/text-base/out.pl.svn-base
  29. +196 −0 bot/cgi/.svn/text-base/search.pl.svn-base
  30. +64 −0 bot/cgi/.svn/text-base/spam.pl.svn-base
  31. +123 −0 bot/cgi/.svn/text-base/style.css.svn-base
  32. +63 −0 bot/cgi/.svn/text-base/text.pl.svn-base
  33. +174 −0 bot/cgi/abbr.dat
  34. BIN bot/cgi/at.png
  35. +1 −0 bot/cgi/cgi.conf
  36. +97 −0 bot/cgi/channel-index.pl
  37. +11 −0 bot/cgi/channels/.svn/all-wcprops
  38. +41 −0 bot/cgi/channels/.svn/entries
  39. +1 −0 bot/cgi/channels/.svn/format
  40. +13 −0 bot/cgi/channels/.svn/prop-base/perl6.tmpl.svn-base
  41. +7 −0 bot/cgi/channels/.svn/text-base/perl6.tmpl.svn-base
  42. +7 −0 bot/cgi/channels/perl6.tmpl
  43. +54 −0 bot/cgi/index.pl
  44. +6 −0 bot/cgi/links.dat
  45. BIN bot/cgi/moose1.ico
  46. BIN bot/cgi/moosecamel.png
  47. +211 −0 bot/cgi/out.pl
  48. +196 −0 bot/cgi/search.pl
  49. +64 −0 bot/cgi/spam.pl
  50. +123 −0 bot/cgi/style.css
  51. +53 −0 bot/cgi/template/.svn/all-wcprops
  52. +130 −0 bot/cgi/template/.svn/entries
  53. +1 −0 bot/cgi/template/.svn/format
  54. +5 −0 bot/cgi/template/.svn/prop-base/channel-index.tmpl.svn-base
  55. +5 −0 bot/cgi/template/.svn/prop-base/day.tmpl.svn-base
  56. +5 −0 bot/cgi/template/.svn/prop-base/footer.tmpl.svn-base
  57. +5 −0 bot/cgi/template/.svn/prop-base/line.tmpl.svn-base
  58. +5 −0 bot/cgi/template/.svn/prop-base/linkblock.tmpl.svn-base
  59. +5 −0 bot/cgi/template/.svn/prop-base/search.tmpl.svn-base
  60. +23 −0 bot/cgi/template/.svn/text-base/channel-index.tmpl.svn-base
  61. +66 −0 bot/cgi/template/.svn/text-base/day.tmpl.svn-base
  62. +5 −0 bot/cgi/template/.svn/text-base/footer.tmpl.svn-base
  63. +25 −0 bot/cgi/template/.svn/text-base/index.tmpl.svn-base
  64. +10 −0 bot/cgi/template/.svn/text-base/line.tmpl.svn-base
  65. +15 −0 bot/cgi/template/.svn/text-base/linkblock.tmpl.svn-base
  66. +68 −0 bot/cgi/template/.svn/text-base/search.tmpl.svn-base
  67. +17 −0 bot/cgi/template/.svn/text-base/spam.tmpl.svn-base
  68. +23 −0 bot/cgi/template/channel-index.tmpl
  69. +66 −0 bot/cgi/template/day.tmpl
  70. +5 −0 bot/cgi/template/footer.tmpl
  71. +25 −0 bot/cgi/template/index.tmpl
  72. +10 −0 bot/cgi/template/line.tmpl
  73. +15 −0 bot/cgi/template/linkblock.tmpl
  74. +68 −0 bot/cgi/template/search.tmpl
  75. +17 −0 bot/cgi/template/spam.tmpl
  76. +63 −0 bot/cgi/text.pl
  77. +5 −0 bot/database.conf
  78. +13 −0 bot/ilbot.sql
  79. +122 −0 bot/ilbot2.pl
  80. +11 −0 bot/lib/.svn/all-wcprops
  81. +44 −0 bot/lib/.svn/entries
  82. +1 −0 bot/lib/.svn/format
  83. +9 −0 bot/lib/.svn/prop-base/IrcLog.pm.svn-base
  84. +67 −0 bot/lib/.svn/text-base/IrcLog.pm.svn-base
  85. +11 −0 bot/lib/IrcLog/.svn/all-wcprops
  86. +41 −0 bot/lib/IrcLog/.svn/entries
  87. +1 −0 bot/lib/IrcLog/.svn/format
  88. +9 −0 bot/lib/IrcLog/.svn/prop-base/WWW.pm.svn-base
  89. +522 −0 bot/lib/IrcLog/.svn/text-base/WWW.pm.svn-base
  90. +522 −0 bot/lib/IrcLog/WWW.pm
  91. +29 −0 bot/t/.svn/all-wcprops
  92. +77 −0 bot/t/.svn/entries
  93. +1 −0 bot/t/.svn/format
  94. +9 −0 bot/t/.svn/prop-base/decode.t.svn-base
  95. +53 −0 bot/t/.svn/text-base/decode.t.svn-base
  96. +25 −0 bot/t/.svn/text-base/http-header.t.svn-base
  97. +61 −0 bot/t/.svn/text-base/revision-links.t.svn-base
  98. +44 −0 bot/t/.svn/text-base/synopsis-links.t.svn-base
  99. +53 −0 bot/t/decode.t
  100. +25 −0 bot/t/http-header.t
  101. +61 −0 bot/t/revision-links.t
  102. +44 −0 bot/t/synopsis-links.t
  103. +11 −0 bot/util/.svn/all-wcprops
  104. +40 −0 bot/util/.svn/entries
  105. +1 −0 bot/util/.svn/format
  106. +23 −0 bot/util/.svn/text-base/to-utf8.pl.svn-base
  107. +23 −0 bot/util/to-utf8.pl
View
@@ -0,0 +1,67 @@
+package IrcLog;
+use warnings;
+use strict;
+use DBI;
+
+#use Smart::Comments;
+use Config::File;
+use Carp;
+use utf8;
+
+require Exporter;
+
+use base 'Exporter';
+our @EXPORT_OK = qw(
+ get_dbh
+ gmt_today
+ );
+
+# get a database handle.
+# you will have to modify that routine to fit your needs
+sub get_dbh {
+ my $conf = Config::File::read_config_file("database.conf");
+ my $dbs = $conf->{DSN} || "mysql";
+ my $db_name = $conf->{DATABASE} || "irclog";
+ my $host = $conf->{HOST} || "localhost";
+ my $user = $conf->{USER} || "irclog";
+ my $passwd = $conf->{PASSWORD} || "";
+
+ my $db_dsn = "DBI:$dbs:database=$db_name;host=$host";
+ my $dbh = DBI->connect($db_dsn, $user, $passwd,
+ {RaiseError=>1, AutoCommit => 1});
+ return $dbh;
+}
+
+# returns current date in GMT in the form YYYY-MM-DD
+sub gmt_today {
+ my @d = gmtime(time);
+ return sprintf("%04d-%02d-%02d", $d[5]+1900, $d[4] + 1, $d[3]);
+}
+
+
+=head1 NAME
+
+IrcLog - common subroutines for ilbot and the corresponding CGI scripts
+
+=head1 SYNOPSIS
+
+there is no synopsis, since the module has no unified API, but is a loose
+collection of subs that are usefull for the irc log bot and the
+corresponding CGI scripts.
+
+=head1 METHODS
+
+* get_dbh
+
+returns a DBI handle to a database. To achieve that, it reads the file
+C<database.conf>.
+
+* gmt_today
+
+returns the current date in the format YYYY-MM-DD, and uses UTC (GMT) to
+dermine the date.
+
+=cut
+
+# vim: ts=4 sw=4 expandtab
+1;
View
@@ -0,0 +1,5 @@
+The documentation can be found at
+http://moritz.faui2k3.org/en/ilbot
+
+However it is very incomplete, in case you really want to use it, ask moritz_
+on #perl6
View
@@ -0,0 +1,18 @@
+* links to colabti irclogs - but how to know for which channels?
+* fix context in search results for adjacent hits
+* fix spam.pl with rewritten URLs
+
+Already done:
+* import of colabti irclogs
+* add context to search results?
+* full text search
+* move to own virtual host
+* use rewrite magic for cleaner URLs
+* some caching for indexes and old pages
+* split listing of all channels and dates per channel
+
+15:29 < [particle]> if you're in the mood for adding more, processing
+ S05:546-549 would be grand. as well as S05/"Nothing is
+ illegal"
+15:30 < [particle]> oh, i should say, *highlighting* the text and processing
+ S05:546-549
View
@@ -0,0 +1 @@
+ALTER TABLE irclog ADD id INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (id);
View
@@ -0,0 +1,7 @@
+# Configuration for the bot
+NICK = irclogger_com
+SERVER = irc.freenode.net
+# currently only one channel is supported; start multiple bots if you
+# want to log more channels
+CHANNEL = \#sinatra \#radiantcms \#datamapper \#sequel \#adhearsion \#integrity \#dm-hacking \#rack \#cucumber \#rspec \#webrat \#capistrano \#poolpartyrb \#monk \#merb \#vagrant \#riak \#ohm \#padrino \#redis \#redis-rb \#akin \#buildr \#ruboto \#cappuccino \#coffeescript \#rubysur \#motion \#couchdb \#extjs \#mplayer \#alsa \#veritas \#rvm
+
View
@@ -0,0 +1,25 @@
+Options +ExecCGI
+AddHandler cgi-script .pl
+
+DirectoryIndex index.pl
+RewriteEngine on
+
+RewriteCond %{HTTP_REQUEST} !^search
+RewriteRule ^([\w-]+)/?$ channel-index.pl?channel=$1 [L]
+
+RewriteCond %{HTTP_REQUEST} !^search
+RewriteRule ^([\w-]+)/today$ out.pl?channel=$1
+
+RewriteCond %{QUERY_STRING} ^channel=([^;]+);date=(\d\d\d\d-\d\d-\d\d)
+RewriteCond %{HTTP_REQUEST} ^out\.pl
+RewriteRule ^out.pl /%1/%2? [R=301,L]
+
+RewriteCond %{HTTP_REQUEST} !^search
+RewriteRule ^([\w-]+)/(\d\d\d\d-\d\d-\d\d) out.pl?channel=$1;date=$2 [L]
+
+RewriteRule ^search/?$ /search.pl
+RewriteRule ^search/(\d+)/(.*)$ /search.pl?offset=$1;q=$2
+RewriteRule ^search/(.*)$ /search.pl?offset=0;q=$2
+
+RewriteRule ^\. - [F]
+RewriteRule \.conf$ - [F]
View
@@ -0,0 +1,89 @@
+K 25
+svn:wc:ra_dav:version-url
+V 36
+/pugs/!svn/ver/21328/misc/irclog/cgi
+END
+search.pl
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/pugs/!svn/ver/21301/misc/irclog/cgi/search.pl
+END
+out.pl
+K 25
+svn:wc:ra_dav:version-url
+V 43
+/pugs/!svn/ver/21328/misc/irclog/cgi/out.pl
+END
+index.pl
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/pugs/!svn/ver/21301/misc/irclog/cgi/index.pl
+END
+cgi.conf
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/pugs/!svn/ver/18608/misc/irclog/cgi/cgi.conf
+END
+style.css
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/pugs/!svn/ver/18645/misc/irclog/cgi/style.css
+END
+links.dat
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/pugs/!svn/ver/19610/misc/irclog/cgi/links.dat
+END
+channel-index.pl
+K 25
+svn:wc:ra_dav:version-url
+V 53
+/pugs/!svn/ver/21301/misc/irclog/cgi/channel-index.pl
+END
+at.png
+K 25
+svn:wc:ra_dav:version-url
+V 43
+/pugs/!svn/ver/16134/misc/irclog/cgi/at.png
+END
+moosecamel.png
+K 25
+svn:wc:ra_dav:version-url
+V 51
+/pugs/!svn/ver/16064/misc/irclog/cgi/moosecamel.png
+END
+spam.pl
+K 25
+svn:wc:ra_dav:version-url
+V 44
+/pugs/!svn/ver/21301/misc/irclog/cgi/spam.pl
+END
+.htaccess
+K 25
+svn:wc:ra_dav:version-url
+V 46
+/pugs/!svn/ver/20508/misc/irclog/cgi/.htaccess
+END
+moose1.ico
+K 25
+svn:wc:ra_dav:version-url
+V 47
+/pugs/!svn/ver/16064/misc/irclog/cgi/moose1.ico
+END
+abbr.dat
+K 25
+svn:wc:ra_dav:version-url
+V 45
+/pugs/!svn/ver/20507/misc/irclog/cgi/abbr.dat
+END
+text.pl
+K 25
+svn:wc:ra_dav:version-url
+V 44
+/pugs/!svn/ver/18537/misc/irclog/cgi/text.pl
+END
Oops, something went wrong.

0 comments on commit ff0c481

Please sign in to comment.