Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove old perl bot related files

  • Loading branch information...
commit 3410019c256cb9bdf53370ee56eb80871b99d009 1 parent b2a5b98
Chris Schneider authored
Showing with 0 additions and 5,175 deletions.
  1. +0 −67 bot/IrcLog.pm
  2. +0 −5 bot/README
  3. +0 −18 bot/TODO
  4. +0 −1  bot/add_id.sql
  5. +0 −25 bot/cgi/.htaccess
  6. +0 −89 bot/cgi/.svn/all-wcprops
  7. +0 −211 bot/cgi/.svn/entries
  8. +0 −1  bot/cgi/.svn/format
  9. +0 −5 bot/cgi/.svn/prop-base/at.png.svn-base
  10. +0 −5 bot/cgi/.svn/prop-base/channel-index.pl.svn-base
  11. +0 −5 bot/cgi/.svn/prop-base/index.pl.svn-base
  12. +0 −5 bot/cgi/.svn/prop-base/moose1.ico.svn-base
  13. +0 −5 bot/cgi/.svn/prop-base/moosecamel.png.svn-base
  14. +0 −5 bot/cgi/.svn/prop-base/out.pl.svn-base
  15. +0 −5 bot/cgi/.svn/prop-base/search.pl.svn-base
  16. +0 −5 bot/cgi/.svn/prop-base/spam.pl.svn-base
  17. +0 −5 bot/cgi/.svn/prop-base/text.pl.svn-base
  18. +0 −25 bot/cgi/.svn/text-base/.htaccess.svn-base
  19. +0 −174 bot/cgi/.svn/text-base/abbr.dat.svn-base
  20. BIN  bot/cgi/.svn/text-base/at.png.svn-base
  21. +0 −1  bot/cgi/.svn/text-base/cgi.conf.svn-base
  22. +0 −97 bot/cgi/.svn/text-base/channel-index.pl.svn-base
  23. +0 −54 bot/cgi/.svn/text-base/index.pl.svn-base
  24. +0 −6 bot/cgi/.svn/text-base/links.dat.svn-base
  25. BIN  bot/cgi/.svn/text-base/moose1.ico.svn-base
  26. BIN  bot/cgi/.svn/text-base/moosecamel.png.svn-base
  27. +0 −211 bot/cgi/.svn/text-base/out.pl.svn-base
  28. +0 −196 bot/cgi/.svn/text-base/search.pl.svn-base
  29. +0 −64 bot/cgi/.svn/text-base/spam.pl.svn-base
  30. +0 −123 bot/cgi/.svn/text-base/style.css.svn-base
  31. +0 −63 bot/cgi/.svn/text-base/text.pl.svn-base
  32. +0 −174 bot/cgi/abbr.dat
  33. BIN  bot/cgi/at.png
  34. +0 −1  bot/cgi/cgi.conf
  35. +0 −97 bot/cgi/channel-index.pl
  36. +0 −11 bot/cgi/channels/.svn/all-wcprops
  37. +0 −41 bot/cgi/channels/.svn/entries
  38. +0 −1  bot/cgi/channels/.svn/format
  39. +0 −13 bot/cgi/channels/.svn/prop-base/perl6.tmpl.svn-base
  40. +0 −7 bot/cgi/channels/.svn/text-base/perl6.tmpl.svn-base
  41. +0 −7 bot/cgi/channels/perl6.tmpl
  42. +0 −54 bot/cgi/index.pl
  43. +0 −6 bot/cgi/links.dat
  44. BIN  bot/cgi/moose1.ico
  45. BIN  bot/cgi/moosecamel.png
  46. +0 −211 bot/cgi/out.pl
  47. +0 −196 bot/cgi/search.pl
  48. +0 −64 bot/cgi/spam.pl
  49. +0 −123 bot/cgi/style.css
  50. +0 −53 bot/cgi/template/.svn/all-wcprops
  51. +0 −130 bot/cgi/template/.svn/entries
  52. +0 −1  bot/cgi/template/.svn/format
  53. +0 −5 bot/cgi/template/.svn/prop-base/channel-index.tmpl.svn-base
  54. +0 −5 bot/cgi/template/.svn/prop-base/day.tmpl.svn-base
  55. +0 −5 bot/cgi/template/.svn/prop-base/footer.tmpl.svn-base
  56. +0 −5 bot/cgi/template/.svn/prop-base/line.tmpl.svn-base
  57. +0 −5 bot/cgi/template/.svn/prop-base/linkblock.tmpl.svn-base
  58. +0 −5 bot/cgi/template/.svn/prop-base/search.tmpl.svn-base
  59. +0 −23 bot/cgi/template/.svn/text-base/channel-index.tmpl.svn-base
  60. +0 −66 bot/cgi/template/.svn/text-base/day.tmpl.svn-base
  61. +0 −5 bot/cgi/template/.svn/text-base/footer.tmpl.svn-base
  62. +0 −25 bot/cgi/template/.svn/text-base/index.tmpl.svn-base
  63. +0 −10 bot/cgi/template/.svn/text-base/line.tmpl.svn-base
  64. +0 −15 bot/cgi/template/.svn/text-base/linkblock.tmpl.svn-base
  65. +0 −68 bot/cgi/template/.svn/text-base/search.tmpl.svn-base
  66. +0 −17 bot/cgi/template/.svn/text-base/spam.tmpl.svn-base
  67. +0 −23 bot/cgi/template/channel-index.tmpl
  68. +0 −66 bot/cgi/template/day.tmpl
  69. +0 −5 bot/cgi/template/footer.tmpl
  70. +0 −25 bot/cgi/template/index.tmpl
  71. +0 −10 bot/cgi/template/line.tmpl
  72. +0 −15 bot/cgi/template/linkblock.tmpl
  73. +0 −68 bot/cgi/template/search.tmpl
  74. +0 −17 bot/cgi/template/spam.tmpl
  75. +0 −63 bot/cgi/text.pl
  76. +0 −5 bot/database.conf
  77. +0 −13 bot/ilbot.sql
  78. +0 −122 bot/ilbot2.pl
  79. +0 −11 bot/lib/.svn/all-wcprops
  80. +0 −44 bot/lib/.svn/entries
  81. +0 −1  bot/lib/.svn/format
  82. +0 −9 bot/lib/.svn/prop-base/IrcLog.pm.svn-base
  83. +0 −67 bot/lib/.svn/text-base/IrcLog.pm.svn-base
  84. +0 −11 bot/lib/IrcLog/.svn/all-wcprops
  85. +0 −41 bot/lib/IrcLog/.svn/entries
  86. +0 −1  bot/lib/IrcLog/.svn/format
  87. +0 −9 bot/lib/IrcLog/.svn/prop-base/WWW.pm.svn-base
  88. +0 −522 bot/lib/IrcLog/.svn/text-base/WWW.pm.svn-base
  89. +0 −522 bot/lib/IrcLog/WWW.pm
  90. +0 −29 bot/t/.svn/all-wcprops
  91. +0 −77 bot/t/.svn/entries
  92. +0 −1  bot/t/.svn/format
  93. +0 −9 bot/t/.svn/prop-base/decode.t.svn-base
  94. +0 −53 bot/t/.svn/text-base/decode.t.svn-base
  95. +0 −25 bot/t/.svn/text-base/http-header.t.svn-base
  96. +0 −61 bot/t/.svn/text-base/revision-links.t.svn-base
  97. +0 −44 bot/t/.svn/text-base/synopsis-links.t.svn-base
  98. +0 −53 bot/t/decode.t
  99. +0 −25 bot/t/http-header.t
  100. +0 −61 bot/t/revision-links.t
  101. +0 −44 bot/t/synopsis-links.t
  102. +0 −11 bot/util/.svn/all-wcprops
  103. +0 −40 bot/util/.svn/entries
  104. +0 −1  bot/util/.svn/format
  105. +0 −23 bot/util/.svn/text-base/to-utf8.pl.svn-base
  106. +0 −23 bot/util/to-utf8.pl
View
67 bot/IrcLog.pm
@@ -1,67 +0,0 @@
-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
5 bot/README
@@ -1,5 +0,0 @@
-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
18 bot/TODO
@@ -1,18 +0,0 @@
-* 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
1  bot/add_id.sql
@@ -1 +0,0 @@
-ALTER TABLE irclog ADD id INT NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (id);
View
25 bot/cgi/.htaccess
@@ -1,25 +0,0 @@
-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
89 bot/cgi/.svn/all-wcprops
@@ -1,89 +0,0 @@
-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
View
211 bot/cgi/.svn/entries
@@ -1,211 +0,0 @@
-8
-
-dir
-21443
-http://svn.pugscode.org/pugs/misc/irclog/cgi
-http://svn.pugscode.org/pugs
-
-
-
-2008-07-13T20:36:13.080783Z
-21328
-moritz
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-c213334d-75ef-0310-aa23-eaa082d1ae64
-
-search.pl
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-b4320c728b0cf5a75b2788cd8c592790
-2008-07-10T22:57:10.083968Z
-21301
-moritz
-has-props
-
-index.pl
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-fb0fcc6d0c1bb385cf74cd571aa20842
-2008-07-10T22:57:10.083968Z
-21301
-moritz
-has-props
-
-out.pl
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-36e2c850f1a8b17aa31801b4d04c2b29
-2008-07-13T20:36:13.080783Z
-21328
-moritz
-has-props
-
-cgi.conf
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-7ec7272f8e640e2e3614eefe6d4a3cfd
-2007-10-23T16:59:50.410517Z
-18608
-moritz
-
-at.png
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-3ff254a2c22be3c592eca88616991438
-2007-04-26T15:48:14.478995Z
-16134
-moritz
-has-props
-
-channel-index.pl
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-0f8adbc8d54aec019a2fe7955742e113
-2008-07-10T22:57:10.083968Z
-21301
-moritz
-has-props
-
-links.dat
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-dd2e66b5ce384a8f03079f4a5803daad
-2008-01-21T16:28:05.907596Z
-19610
-moritz
-
-style.css
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-f5ad31e3aade0707ff8aebb8ce37981e
-2007-10-24T15:41:17.653053Z
-18645
-moritz
-
-channels
-dir
-
-text.pl
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-eace01743f3f466af852375e70d56673
-2007-10-21T21:32:29.651030Z
-18537
-moritz
-has-props
-
-moosecamel.png
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-0ccad41d7d30430b25a4e7c77b1c1a5c
-2007-04-22T13:56:42.020668Z
-16064
-moritz
-has-props
-
-spam.pl
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-f676efec844e5b7c6b5bcc3a5a3efce7
-2008-07-10T22:57:10.083968Z
-21301
-moritz
-has-props
-
-.htaccess
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-bfe158e120c28a8c82498660fe05379c
-2008-05-23T16:10:40.268203Z
-20508
-moritz
-
-template
-dir
-
-moose1.ico
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-5d887157c45ab8f938342f03a9ae6533
-2007-04-22T13:56:42.020668Z
-16064
-moritz
-has-props
-
-abbr.dat
-file
-
-
-
-
-2008-07-23T02:37:57.000000Z
-508400200ca949de15f086bc313c177b
-2008-05-23T16:09:54.437517Z
-20507
-moritz
-
View
1  bot/cgi/.svn/format
@@ -1 +0,0 @@
-8
View
5 bot/cgi/.svn/prop-base/at.png.svn-base
@@ -1,5 +0,0 @@
-K 13
-svn:mime-type
-V 24
-application/octet-stream
-END
View
5 bot/cgi/.svn/prop-base/channel-index.pl.svn-base
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
View
5 bot/cgi/.svn/prop-base/index.pl.svn-base
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
View
5 bot/cgi/.svn/prop-base/moose1.ico.svn-base
@@ -1,5 +0,0 @@
-K 13
-svn:mime-type
-V 24
-application/octet-stream
-END
View
5 bot/cgi/.svn/prop-base/moosecamel.png.svn-base
@@ -1,5 +0,0 @@
-K 13
-svn:mime-type
-V 24
-application/octet-stream
-END
View
5 bot/cgi/.svn/prop-base/out.pl.svn-base
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
View
5 bot/cgi/.svn/prop-base/search.pl.svn-base
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
View
5 bot/cgi/.svn/prop-base/spam.pl.svn-base
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
View
5 bot/cgi/.svn/prop-base/text.pl.svn-base
@@ -1,5 +0,0 @@
-K 14
-svn:executable
-V 1
-*
-END
View
25 bot/cgi/.svn/text-base/.htaccess.svn-base
@@ -1,25 +0,0 @@
-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
174 bot/cgi/.svn/text-base/abbr.dat.svn-base
@@ -1,174 +0,0 @@
-YAPC --- Yet Another Perl Conference
-PCR --- Pugs::Compiler::Rule
-PGE --- Parser Grammar Engine
-PIR --- Parrot Intermediate Representation
-TPF --- The Perl Foundation
-SVN --- Subversion
-CPAN --- Comprehensive Perl Archive Network
-VM --- Virtual Machine
-PCRE --- Perl-Compatible Regular Expressions
-REPL --- Read-Eval-Print Loop
-MOP --- Meta-Object Protocol
-OO --- Object-Oriented
-OOP --- Object-Oriented Programming
-ASM --- Assembler
-SML --- Standard ML
-(?i:KP6) --- KindaPerl6 --- KP6
-(?i:MP6) --- MiniPerl6 --- MP6
-HTML --- Hypertext Markup Language
-XHTML --- Extensible Hypertext Markup Language
-RAM --- Random Access Memory
-AST --- Abstract Syntax Tree
-MIME --- Multipurpose Internet Mail Extensions
-CGI --- Common Gateway Interface
-HTTP --- Hypertext Transfer Protocol
-LWP --- libwww-perl
-XML --- Extensible Markup Language
-FTP --- File Transfer Protocol
-URL --- Uniform Resource Locator
-URI --- Uniform Resource Identifier
-PAST --- Parrot Abstract Syntax Tree
-TGE --- Tree Grammar Engine
-p5p --- Perl 5 Porters Mailing List
-IRC --- Internet Relay Chat
-(?i:CSS) --- Cascading Stylesheets --- CSS
-(?i:SQL) --- Structured Query Language --- SQL
-p5p --- perl5-porters
-(?i:PBP) --- Perl Best Practices --- PBP
-(?i:P6) --- Perl 6 --- P6
-(?i:P5) --- Perl 5 --- P5
-RFC --- Request For Comments
-UTF --- Unicode Transformation Format
-UCS --- Universal Character Set
-ISO --- International Organization for Standardization
-UTC --- Coordinated Universal Timecode
-TAP --- Test Anything Protocol
-RSS --- Rich Site Summary
-GHC --- Glasgow Haskell Compiler --- GHC
-RDBMS --- Relational Database Management System
-DBMS --- Database Management System
-API --- Application Programming Interface
-(?i:win32) --- Windows (32-bit) --- Win32
-STM --- Software Transactional Memory
-(?i:IO) --- Input/Output --- IO
-(?i:I/O) --- Input/Output --- I/O
-POD --- Plain Old Documentation
-TDD --- Test-Driven Development
-YAML --- YAML Ain't Markup Language
-JIT --- Just-In-Time
-CPU --- Central Processing Unit
-TCP --- Transmission Control Protocol
-IP --- Internet Protocol
-(?i:JAPH) --- Just Another Perl Hacker --- JAPH
-APL --- A Programming Language
-OS --- Operating Systems
-FBSD --- FreeBSD
-(?i:RGB) --- Red, Green, Blue --- RGB
-JPEG --- Joint Photographic Experts Group
-MPEG --- Moving Picture Experts Group
-JPG --- Joint Photographic Experts Group
-MPG --- Moving Picture Experts Group
-GB --- Gigabyte
-MB --- Megabyte
-KB --- Kilobyte
-(?i:P2P) --- Peer-To-Peer --- P2P
-MS --- Microsoft
-DB --- Database
-TBD --- To Be Done
-HLL --- High-Level Language
-PAUSE --- Perl Authors Upload Server
-DNS --- Domain Name Server
-(?i:poco-irc) --- POE::Component::IRC --- PoCo-IRC
-(?i:pocoirc) --- POE::Component::IRC --- PoCoIRC
-CMS --- Content Management System
-WML --- Wireless Markup Language
-SWIG --- Simplified Wrapper and Interface Generator
-QDOS --- Quick and Dirty Operating System
-QDRDBMS --- Quick and Dirty Relational Database Management System
-CLOS --- Common Lisp Object System
-ORM --- Object-Relational Mapping
-PMC --- Parrot Magic Cookie
-FFI --- Foreign Function Interface
-PDD --- Parrot Design Document
-(?i:DWIM) --- Do What I Mean --- DWIM
-(?i:pugs) --- Perl 6 User's Golfing System --- pugs
-GPL --- GNU General Public License
-LGPL --- GNU Lesser General Public License
-JSP --- JavaServer Pages
-FQDN --- Fully Qualified Domain Name
-IPv6 --- Internet Protocol version 6
-IPv4 --- Internet Protocol version 4
-DSL --- Domain-Specific Language
-SSH --- Secure Shell
-NCI --- Native Call Interface
-CRLF --- Carriage Return/Line Feed
-FLOSS --- Free/Libre/Open-Source Software
-FOSS --- Free/Open-Source Software
-(?i:OSCON) --- O'Reilly Open Source Convention --- OSCON
-(?i:DBC) --- Design By Contract --- DBC
-JVM --- Java Virtual Machine
-PDP --- Personal Data Processor
-ASCII --- American Standard Code for Information Interchange
-GC --- Garbage Collection/Collector
-TCC --- Tiny C Compiler
-IE --- Internet Explorer
-VCS --- Version Control System
-SCM --- Software Configuration Management
-JSON --- JavaScript Object Notation
-DLR --- Dynamic Language Runtime
-GPG --- GNU Privacy Guard
-PGP --- Pretty Good Privacy
-GUI --- Graphical User Interface
-OFTC --- Open and Free Technology Community
-PIL --- Pugs Intermediate Language
-JS --- JavaScript
-yacc --- Yet Another Compiler Compiler
-SIP --- Session Initiation Protocol
-VoIP --- Voice over Internet Protocol
-LAMP --- Linux, Apache, MySQL & Perl
-SBCL --- Steel Bank Common Lisp
-EU::MM --- ExtUtils::MakeMaker
-M::B --- Module::Build
-M::I --- Module::Install
-LLVM --- Low Level Virtual Machine
-RHEL --- Red Hat Enterprise Linux
-PHP --- Pansies Hate Perl
-PAM --- Pluggable Authentication Modules
-OCR --- Optical Character Recognition
-HoH --- Hash of Hashes
-OLED --- Organic Light Emitting Diode
-TT --- Template Toolkit
-CL --- Common Lisp
-PPI --- Perl Parsing Interface
-RC --- Release Candidate
-HTTPS --- Secure Hypertext Transfer Protocol
-PASM --- Parrot assembly language
-GMP --- GNU Multi-Precision Library
-ABNF --- Augmented Backus-Naur Form
-BNF --- Backus-Naur Form
-IDE --- Integrated Development Environment
-SAX --- Simple API for XML
-StAX --- Streaming API for XML
-DOM --- Document Object Model
-SVG --- Scalable Vector Graphics
-XSL --- Extensible Stylesheet Language
-CVS --- Concurrent Versions System
-UML --- Unified Modelling Language
-NYI --- Not Yet Implemented
-LHS --- Left Hand Side
-RHS --- Right Hand Side
-TZ --- Timezone
-SDL --- Simple DirectMedia Layer
-MMD --- Multimethod Dispatch
-HPC --- Haskell Program Coverage
-AJAX --- Asynchronous JavaScript and XML
-CLI --- Command Line Interface
-TLD --- Top-Level Domain
-PCI --- Peripheral Component Interconnect
-USB --- Universal Serial Bus
-RAID --- Redundant Array of Independent Disks
-XSL --- Extensible Stylesheet Language
-XSLT --- Extensible Stylesheet Language Transformations
-CPS --- Continuation Passing Style
-PCT --- Parrot Compiler Toolkit
-red_STD --- Ruby version of STD
View
BIN  bot/cgi/.svn/text-base/at.png.svn-base
Binary file not shown
View
1  bot/cgi/.svn/text-base/cgi.conf.svn-base
@@ -1 +0,0 @@
-BASE_URL = /
View
97 bot/cgi/.svn/text-base/channel-index.pl.svn-base
@@ -1,97 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Date::Simple qw(date);
-use CGI::Carp qw(fatalsToBrowser);
-use CGI;
-use HTML::Entities;
-use HTML::Template;
-use Config::File;
-use HTML::Calendar::Simple;
-use Cache::FileCache;
-use lib 'lib';
-use IrcLog qw(get_dbh gmt_today);
-
-my $q = new CGI;
-my $channel = $q->url_param('channel');
-print "Content-Type: text/html; charset=utf-8\n\n";
-
-my $cache_name = $channel . '|' . gmt_today();
-
-my $cache = new Cache::FileCache( {
- namespace => 'irclog',
- } );
-my $data = $cache->get($cache_name);
-if (! defined $data){
- $data = get_channel_index();
- $cache->set($data, '2 hours');
-}
-print $data;
-
-sub get_channel_index {
-
- my $conf = Config::File::read_config_file('cgi.conf');
- my $base_url = $conf->{BASE_URL} || q{/};
- my $t = HTML::Template->new(
- filename => 'template/channel-index.tmpl',
- die_on_bad_params => 0,
- );
-
- my $dbh = get_dbh();
-
- # we are evil and create a calendar entry for month between the first
- # and last date
- my $q3 = $dbh->prepare('SELECT DISTINCT day FROM irclog WHERE channel = ?');
-
-
- $t->param(CHANNEL => $channel);
- $t->param(BASE_URL => $base_url);
- $t->param(CALENDAR => calendar_for_channel($channel, $q3, $base_url));
- return $t->output;
-}
-
-sub calendar_for_channel {
- my ($channel, $query, $base_url) = @_;
- $query->execute('#' . $channel);
- $channel =~ s/\A\#//smx;
- my %cals;
- while (my ($day) = $query->fetchrow_array){
- # extract year and month part: (YYYY-MM)
- my $key = substr $day, 0, 7;
- # day
- my $d = substr $day, 8;
-
- # create calendar
- if (not exists $cals{$key}){
- my ($year, $month) = split m/-/smx, $key;
- $cals{$key} = HTML::Calendar::Simple->new({
- year => $year,
- month => $month,
- });
- }
-
- # populate calendar with links
- $cals{$key}->daily_info({
- day => $d,
- day_link => "$base_url$channel/$day",
- });
- }
-
- # now generate the HTML output
- my $html = q{};
- my $sorter = sub {
- my ($l, $r) = @_;
- return 12 * $cals{$l}->year + $cals{$l}->month
- <=> 12 * $cals{$r}->year + $cals{$r}->month;
- };
-
- for my $cal (reverse sort { &$sorter($a, $b) } keys %cals){
- $html .= qq{\n<div class="calendar">}
- . $cals{$cal}->calendar_month
- . qq{</div>\n}
- }
-
- return $html;
-}
-
-# vim: syn=perl sw=4 ts=4 expandtab
View
54 bot/cgi/.svn/text-base/index.pl.svn-base
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-use CGI::Carp qw(fatalsToBrowser);
-use strict;
-use warnings;
-use Config::File;
-use HTML::Template;
-use lib 'lib';
-use IrcLog qw(get_dbh);
-use IrcLog::WWW qw(http_header);
-
-use Cache::FileCache;
-
-print http_header();
-my $cache = new Cache::FileCache( {
- namespace => 'irclog',
- } );
-
-my $data;
-$data = $cache->get('index');
-if ( ! defined $data){
- $data = get_index();
- $cache->set('index', $data, '5 hours');
-}
-print $data;
-
-sub get_index {
-
- my $dbh = get_dbh();
-
- my $conf = Config::File::read_config_file('cgi.conf');
- my $base_url = $conf->{BASE_URL} || q{/irclog/};
-
- my $sth = $dbh->prepare("SELECT DISTINCT channel FROM irclog");
- $sth->execute();
-
- my @channels;
-
- while (my @row = $sth->fetchrow_array()){
- $row[0] =~ s/^\#//;
- push @channels, { channel => $row[0] };
- }
-
- my $template = HTML::Template->new(
- filename => 'template/index.tmpl',
- loop_context_vars => 1,
- global_vars => 1,
- die_on_bad_params => 0,
- );
- $template->param(BASE_URL => $base_url);
- $template->param( channels => \@channels );
-
-
- return $template->output;
-}
View
6 bot/cgi/.svn/text-base/links.dat.svn-base
@@ -1,6 +0,0 @@
-p6l --- http://www.nntp.perl.org/group/perl.perl6.language/
-perl6-language --- http://www.nntp.perl.org/group/perl.perl6.language/
-perl6-users --- http://www.nntp.perl.org/group/perl.perl6.users/
-p6c --- http://www.nntp.perl.org/group/perl.perl6.compiler/
-perl6-compiler --- http://www.nntp.perl.org/group/perl.perl6.compiler/
-smop --- http://www.perlfoundation.org/perl6/index.cgi?smop
View
BIN  bot/cgi/.svn/text-base/moose1.ico.svn-base
Binary file not shown
View
BIN  bot/cgi/.svn/text-base/moosecamel.png.svn-base
Binary file not shown
View
211 bot/cgi/.svn/text-base/out.pl.svn-base
@@ -1,211 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Carp qw(confess);
-use CGI::Carp qw(fatalsToBrowser);
-use Date::Simple qw(date);
-use Encode::Guess;
-use CGI;
-use Encode;
-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 Cache::SizeAwareFileCache;
-#use Data::Dumper;
-
-
-# Configuration
-# $base_url is the absoulte URL to the directoy where index.pl and out.pl live
-# If they live in the root of their own virtual host, set it to "/".
-my $conf = Config::File::read_config_file('cgi.conf');
-my $base_url = $conf->{BASE_URL} || q{/};
-print http_header();
-
-# I'm too lazy right to move this to a config file, because Config::File seems
-# unable to handle arrays, just hashes.
-
-# map nicks to CSS classes.
-my @colors = (
- ['TimToady', 'nick_timtoady'],
- ['audreyt', 'nick_audreyt'],
- ['evalbot', 'bots'],
- ['exp_evalbot', 'bots'],
- ['p6eval', 'bots'],
- ['lambdabot', 'bots'],
- ['pugs_svnbot', 'bots'],
- ['pugs_svn', 'bots'],
- ['specbot', 'bots'],
- ['speckbot', 'bots'],
- ['pasteling', 'bots'],
- ['rakudo_svn', 'bots'],
- ['purl', 'bots'],
- ['svnbotlt', 'bots'],
- ['dalek', 'bots'],
- );
-# additional classes for nicks, sorted by frequency of speech:
-my @nick_classes = map { "nick$_" } (1 .. 9);
-
-# Default channel: this channel will be shown if no channel=... arg is given
-my $default_channel = 'perl6';
-
-# End of config
-
-my $q = new CGI;
-my $dbh = get_dbh();
-my $channel = $q->param('channel') || $default_channel;
-my $date = $q->param('date') || gmt_today();
-if ($date eq 'today') {
- $date = gmt_today();
-}
-
-
-if ($channel !~ m/\A[\w-]+\z/smx){
- # guard against channel=../../../etc/passwd or so
- confess 'Invalid channel name';
-}
-
-my $count;
-{
- my $sth = $dbh->prepare_cached('SELECT COUNT(*) FROM irclog WHERE day = ?');
- $sth->execute($date);
- $sth->bind_columns(\$count);
- $sth->fetch();
- $sth->finish();
-}
-
-
-{
- my $cache_key = $channel . '|' . $date . '|' . $count;
- # the average #perl6 day produces 100k to 400k of HTML, so with
- # 50MB we have about 150 pages in the cache. Since most hits are
- # the "today" page and those of the last 7 days, we still get a very
- # decent speedup
- # btw a cache hit is about 10 times faster than generating the page anew
- my $cache = new Cache::SizeAwareFileCache( {
- namespace => 'irclog',
- max_size => 150 * 1048576,
- } );
- my $data = $cache->get($cache_key);
- if (defined $data){
- print $data;
- } else {
- $data = irclog_output($date, $channel);
- $cache->set($cache_key, $data);
- print $data;
- }
-}
-
-sub irclog_output {
- my ($date, $channel) = @_;
-
- my $full_channel = q{#} . $channel;
- my $t = HTML::Template->new(
- filename => 'template/day.tmpl',
- loop_context_vars => 1,
- global_vars => 1,
- die_on_bad_params => 0,
- );
-
- $t->param(ADMIN => 1) if ($q->param('admin'));
-
- {
- my $clf = "channels/$channel.tmpl";
- if (-e $clf) {
- $t->param(CHANNEL_LINKS => q{} . read_file($clf));
- }
- }
- $t->param(BASE_URL => $base_url);
- my $self_url = $base_url . "/$channel/$date";
- my $db = $dbh->prepare('SELECT id, nick, timestamp, line FROM irclog '
- . 'WHERE day = ? AND channel = ? AND NOT spam ORDER BY id');
- $db->execute($date, $full_channel);
-
-
-# determine which colors to use for which nick:
- {
- my $count = scalar @nick_classes + scalar @colors + 1;
- my $q1 = $dbh->prepare('SELECT nick, COUNT(nick) AS c FROM irclog'
- . ' WHERE day = ? AND channel = ? AND not spam'
- . " GROUP BY nick ORDER BY c DESC LIMIT $count");
- $q1->execute($date, $full_channel);
- while (my @row = $q1->fetchrow_array and @nick_classes){
- next unless length $row[0];
- my $n = quotemeta $row[0];
- unless (grep { $_->[0] =~ m/\A$n/smx } @colors){
- push @colors, [$row[0], shift @nick_classes];
- }
- }
-# $t->param(DEBUG => Dumper(\@colors));
- }
-
- my @msg;
-
- my $line = 1;
- my $prev_nick = q{};
- my $c = 0;
-
-# populate the template
- my $line_number = 0;
- while (my @row = $db->fetchrow_array){
- my $id = $row[0];
- my $nick = decode('utf8', ($row[1]));
- my $timestamp = $row[2];
- my $message = $row[3];
- next if $message =~ m/^\s*\[off\]/i;
-
- push @msg, message_line( {
- id => $id,
- nick => $nick,
- timestamp => $timestamp,
- message => $message,
- line_number => ++$line_number,
- prev_nick => $prev_nick,
- colors => \@colors,
- self_url => $self_url,
- channel => $channel,
- },
- \$c,
- );
- $prev_nick = $nick;
- }
-
- $t->param(
- CHANNEL => $channel,
- MESSAGES => \@msg,
- DATE => $date,
- );
-
-# check if previous/next date exists in database
- {
- my $q1 = $dbh->prepare('SELECT COUNT(*) FROM irclog '
- . 'WHERE channel = ? AND day = ? AND NOT spam');
- # Date::Simple magic ;)
- my $tomorrow = date($date) + 1;
- $q1->execute($full_channel, $tomorrow);
- my ($res) = $q1->fetchrow_array();
- if ($res){
- my $next_url = $base_url . "$channel/$tomorrow";
- # where the hell does the leading double slash come from?
- $next_url =~ s{^//+}{/};
- $t->param(NEXT_URL => $next_url);
- }
-
- my $yesterday = date($date) - 1;
- $q1->execute($full_channel, $yesterday);
- ($res) = $q1->fetchrow_array();
- if ($res){
- my $prev_url = $base_url . "$channel/$yesterday";
- $prev_url =~ s{^//+}{/};
- $t->param(PREV_URL => $prev_url);
- }
-
- }
-
- return my_encode($t->output);
-}
-
-
-# vim: sw=4 ts=4 expandtab
View
196 bot/cgi/.svn/text-base/search.pl.svn-base
@@ -1,196 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Date::Simple qw(today);
-use CGI::Carp qw(fatalsToBrowser);
-use Encode::Guess;
-use CGI;
-use Encode;
-use HTML::Entities;
-use HTML::Template;
-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;
-
-my $conf = Config::File::read_config_file("cgi.conf");
-my $base_url = $conf->{BASE_URL} || "/";
-my $days_per_page = 10;
-my $lines_per_day = 50; # not yet used
-
-my $lines_of_context = 2;
-
-my $q = new CGI;
-print http_header();
-my $t = HTML::Template->new(
- filename => "template/search.tmpl",
- global_vars => 1,
- die_on_bad_params => 0,
-);
-$t->param(BASE_URL => $base_url);
-my $start = $q->param("start") || 0;
-
-my $offset = $q->param("offset") || 0;
-die unless $offset =~ m/^\d+$/;
-
-my $dbh = get_dbh();
-{
- # populate the select box with possible channel names to search in
- my @channels;
- my $q1 = $dbh->prepare("SELECT DISTINCT channel FROM irclog ORDER BY channel");
- $q1->execute();
- my $ch = $q->param('channel') || 'perl6';
- $ch =~ s/^\#//;
- $t->param(CURRENT_CHANNEL => $ch, CHANNEL => $ch);
- while (my @row = $q1->fetchrow_array){
- $row[0] =~ s/^\#//;
- if ($ch eq $row[0]){
- push @channels, {CHANNEL => $row[0], SELECTED => 1};
- } else {
- push @channels, {CHANNEL => $row[0]};
- }
- }
-
- # populate the size of the select box with channel names
- $t->param(CHANNELS => \@channels);
- if (@channels >= 5 ){
- $t->param(CH_COUNT => 5);
- } else {
- $t->param(CH_COUNT => scalar @channels);
- }
-}
-
-my $nick = decode('utf8', $q->param('nick') || '');
-#my $qs = decode('utf8', $q->param('q') || '');
-my $qs = $q->param('q') || '';
-$qs = my_decode($qs);
-
-
-$t->param(NICK => encode('utf8', $nick));
-$t->param(Q => $qs);
-my $short_channel = decode('utf8', $q->param('channel') || 'perl6');
-# guard against old URLs:
-$short_channel =~ s/^#//;
-my $channel = '#' .$short_channel;
-
-
-if (length($nick) or length($qs)){
-
-
-
- my @sql_conds = ('channel = ? AND NOT spam');
- my @args = ($channel);
- if (length $nick){
- push @sql_conds, '(nick = ? OR nick = ?)';
- push @args, $nick, "* $nick";
- }
- if (length $qs) {
- push @sql_conds, 'MATCH(line) AGAINST(?)';
- push @args, $qs;
- }
- my $sql_cond = 'WHERE ' . join(' AND ', @sql_conds);
-
-# warn $sql_cond;
-# warn join '|', @args;
-
- my $q0 = $dbh->prepare("SELECT COUNT(DISTINCT day) FROM irclog $sql_cond");
- my $q1 = $dbh->prepare("SELECT DISTINCT day FROM irclog $sql_cond "
- . "ORDER BY day DESC LIMIT $days_per_page OFFSET $offset");
- my $q2 = $dbh->prepare("SELECT id, day FROM irclog "
- . $sql_cond . ' AND day = ? ORDER BY id');
- my $q3 = $dbh->prepare('SELECT id, timestamp, nick, line FROM irclog '
- . 'WHERE day = ? AND id >= ? AND id <= ? ORDER BY id ASC');
-
- $q0->execute(@args);
- my $result_count = ($q0->fetchrow_array);
- $t->param(DAYS_COUNT => $result_count);
- $t->param(DAYS_LOWER => $offset + 1);
- $t->param(DAYS_UPPER => min($offset + $days_per_page, $result_count));
-
- my @result_pages;
- my $p = 1;
- for (my $o = 0; $o <= $result_count; $o += $days_per_page){
- push @result_pages, { OFFSET => $o, PAGE => $p++ };
- }
- $t->param(RESULT_PAGES => \@result_pages);
-
- $q1->execute(@args);
- my @days;
- my $c = 0;
-
- my $line_number = 1; # not really needed any more
-
- while (my @row = $q1->fetchrow_array){
-
- # should be smaller than any index in the `id` column:
- my $last_context = -5e10;
-
- my $prev_nick = "";
- my @lines;
- $q2->execute(@args, $row[0]);
- while (my ($found_id, $found_day) = $q2->fetchrow_array){
-
- # determine the context range:
- my $lower = max($last_context + 1, $found_id - $lines_of_context);
- my $upper = $found_id + $lines_of_context;
- $last_context = $upper;
-
- # retrieve context from database
- $q3->execute( $found_day, $lower, $upper );
- while (my @r2 = $q3->fetchrow_array){
- my %args = (
- id => $r2[0],
- nick => decode('utf8', $r2[2]),
- timestamp => $r2[1],
- message => $r2[3],
- line_number => $line_number++,
- prev_nick => $prev_nick,
- colors => [],
- link_url => $base_url . "out.pl?channel=$short_channel;date=$row[0]",
- channel => $channel,
- date => $found_day,
- );
- $args{search_found} = 'search_found' if $r2[0] == $found_id;
-
- push @lines, message_line(
- \%args,
- \$c,
- );
- }
- }
- push @days, {
- URL => $base_url . "out.pl?channel=$short_channel;date=$row[0]",
- DAY => $row[0],
- LINES => \@lines,
- };
- }
- $t->param(DAYS => \@days);
-
-}
-
-print my_encode($t->output);
-#print $t->output;
-
-sub hexdump {
- my $str = shift;
- my $res = q{};
- for (0 .. length($str) - 1){
- $res .= sprintf "%%%x", ord(substr $str, $_, 1);
- }
- return $res;
-}
-
-sub search_with_context {
- my ($q2, $q3) = @_;
- my @ids;
- my $day;
- ($ids[0], $day) = $q2->fetchrow_array();
-
-
-
-}
-
View
64 bot/cgi/.svn/text-base/spam.pl.svn-base
@@ -1,64 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use CGI::Carp qw(fatalsToBrowser);
-use Carp qw(confess);
-use lib '..';
-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();
-
-my @range = sort $q->param("range");
-my @single = $q->param("single");
-
-my $dbh = get_dbh();
-
-my $range_count = scalar @range;
-
-my $d1 = $dbh->prepare("UPDATE irclog SET spam = 1 WHERE id >= ? AND id <= ?");
-my $d2 = $dbh->prepare("UPDATE irclog SET spam = 1 WHERE id = ?");
-
-my $count = 0;
-
-if ($range_count == 2){
- $count += $d1->execute($range[0], $range[1]);
-}
-elsif ($range_count == 0){
- # do nothing
-}
-else {
- confess "Select $range_count 'range' checkboxes, for security reasons only "
- . "two (or zero) are allowed";
-}
-
-for my $id (@single){
- $count += $d2->execute($id);
-}
-
-my $t = HTML::Template->new(
- filename => 'template/spam.tmpl',
- die_on_bad_params => 0,
-);
-
-my $conf = Config::File::read_config_file("cgi.conf");
-my $base_url = $conf->{BASE_URL} || "/";
-my $channel = $q->url_param('channel');
-$channel =~ s/^\#//x;
-
-$t->param(DATE => $q->url_param('date'));
-$t->param(COUNT => $count);
-$t->param(BASE_URL => $base_url);
-$t->param(CHANNEL => $channel);
-
-
-print http_header({no_xhtml => 1});
-
-print $t->output;
-
-# vim: expandtab sw=4 ts=4
View
123 bot/cgi/.svn/text-base/style.css.svn-base
@@ -1,123 +0,0 @@
-body {
- background-color: white;
- color: black;
-}
-
-h1, h2, h3, #footer * {
- color: #70709f;
- clear: left;
-}
-
-
-#footer {
- background-color: #ececef;
- border-color: #c0c0ff;
- color: inherit;
- border-top: 2px solid;
- border-bottom: 2px solid;
- margin-bottom: 0.2em;
- padding-top: 0.75ex;
- padding-bottom: 0.75ex;
- min-height: 4.7ex;
- clear: left;
-}
-
-#footer * {
- background-color: inherit;
- font-size: 92%;
-}
-
-tr, td {
- vertical-align: top;
-}
-
-.dark {
- background-color: #efefef;
-}
-
-.special {
- font-size: 80%;
-}
-.special * {
- color: gray;
-}
-
-#log {
- border-collapse: collapse;
- width: 100%;
- border: 1px solid #efefef;
-}
-
-#log tr { border-top: 1px solid #efefef; }
-#log tr.head, #log tr.dark.new { border-top-style: none; }
-#log tr.dark { border-top: 1px solid #dfdfdf; }
-
-#log td, th {
- font-family: Consolas, "Lucida Console", "Courier New", monospace;
- padding: 0.2em 0.4em;
-}
-
-#log th { border-bottom: 1px solid #C0C0C0; }
-
-#log .nick {
- text-align: right;
- border-right: 1px solid #C0C0C0;
-}
-
-#log .time { border-left: 1px solid #efefef; }
-#log .msg { border-right: 1px solid #efefef; line-height: 1.3em; }
-#log .act { font-style: italic; }
-
-.log-index li {
- display: inline;
-}
-
-label,input {
- display: block;
- width: 10em;
- float: left;
- margin-bottom: 2ex;
-}
-
-label {
- text-align: right;
- width: 8em;
- padding-right: 2ex;
-}
-
-br {
- clear: left;
-}
-
-/* index page */
-
-.calendar {
- float: left;
-}
-
-/* most important channel members. This is subjective, if you have a different
- * opinion, feel free to change */
-.nick_timtoady { color: green; font-weight: bold; }
-.nick_audreyt { color: red; font-weight: bold;}
-
-
-/* all "active" bots, (svnbot6, lambdabot, specbot etc.) */
-.bots {color: #FFA500; font-style: italic}
-
-/* The rest gets dynamically allocated colors */
-.nick1 { color: #00AA33; }
-.nick2 { color: #AA0000; }
-.nick3 { color: #005500; }
-.nick4 { color: #FF0077; }
-.nick5 { color: blue; }
-.nick6 { color: #8B008B; }
-.nick7 { color: #50507f; }
-.nick8 { color: #00008B; }
-.nick9 { color: #222222; }
-
-abbr { cursor: help; }
-
-.search_found {
- font-weight: bold;
-}
-
View
63 bot/cgi/.svn/text-base/text.pl.svn-base
@@ -1,63 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Carp qw(confess);
-use CGI::Carp qw(fatalsToBrowser);
-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';
-
-# End of config
-
-my $q = new CGI;
-my $dbh = get_dbh();
-my $channel = $q->param('channel') || $default_channel;
-
-my $date = $q->param('date') || gmt_today;
-
-if ($channel !~ m/^\w+\z/sx){
- # guard against channel=../../../etc/passwd or so
- confess 'Invalid channel name';
-}
-my $db = $dbh->prepare('SELECT nick, timestamp, line FROM irclog '
- . 'WHERE day = ? AND channel = ? AND NOT spam ORDER BY id');
-$db->execute($date, '#' . $channel);
-
-
-print "Content-Type: text/html;charset=utf-8\n\n";
-print <<HTML_HEADER;
-<html>
-<head>
-<title>IRC Logs</title>
-</head>
-<body>
-<pre>
-HTML_HEADER
-
-my $table = Text::Table->new(qw(Time Nick Message));
-
-while (my $row = $db->fetchrow_hashref){
- next unless length($row->{nick});
- my ($hour, $minute) =(gmtime $row->{timestamp})[2,1];
- $table->add(
- sprintf("%02d:%02d", $hour, $minute),
- $row->{nick},
- $row->{line},
- );
-}
-my $text = encode_entities($table, '<>&');
-print encode("utf-8", $text);
-
-print "</pre></body></html>\n"
-
-
-
-# vim: sw=4 ts=4 expandtab
View
174 bot/cgi/abbr.dat
@@ -1,174 +0,0 @@
-YAPC --- Yet Another Perl Conference
-PCR --- Pugs::Compiler::Rule
-PGE --- Parser Grammar Engine
-PIR --- Parrot Intermediate Representation
-TPF --- The Perl Foundation
-SVN --- Subversion
-CPAN --- Comprehensive Perl Archive Network
-VM --- Virtual Machine
-PCRE --- Perl-Compatible Regular Expressions
-REPL --- Read-Eval-Print Loop
-MOP --- Meta-Object Protocol
-OO --- Object-Oriented
-OOP --- Object-Oriented Programming
-ASM --- Assembler
-SML --- Standard ML
-(?i:KP6) --- KindaPerl6 --- KP6
-(?i:MP6) --- MiniPerl6 --- MP6
-HTML --- Hypertext Markup Language
-XHTML --- Extensible Hypertext Markup Language
-RAM --- Random Access Memory
-AST --- Abstract Syntax Tree
-MIME --- Multipurpose Internet Mail Extensions
-CGI --- Common Gateway Interface
-HTTP --- Hypertext Transfer Protocol
-LWP --- libwww-perl
-XML --- Extensible Markup Language
-FTP --- File Transfer Protocol
-URL --- Uniform Resource Locator
-URI --- Uniform Resource Identifier
-PAST --- Parrot Abstract Syntax Tree
-TGE --- Tree Grammar Engine
-p5p --- Perl 5 Porters Mailing List
-IRC --- Internet Relay Chat
-(?i:CSS) --- Cascading Stylesheets --- CSS
-(?i:SQL) --- Structured Query Language --- SQL
-p5p --- perl5-porters
-(?i:PBP) --- Perl Best Practices --- PBP
-(?i:P6) --- Perl 6 --- P6
-(?i:P5) --- Perl 5 --- P5
-RFC --- Request For Comments
-UTF --- Unicode Transformation Format
-UCS --- Universal Character Set
-ISO --- International Organization for Standardization
-UTC --- Coordinated Universal Timecode
-TAP --- Test Anything Protocol
-RSS --- Rich Site Summary
-GHC --- Glasgow Haskell Compiler --- GHC
-RDBMS --- Relational Database Management System
-DBMS --- Database Management System
-API --- Application Programming Interface
-(?i:win32) --- Windows (32-bit) --- Win32
-STM --- Software Transactional Memory
-(?i:IO) --- Input/Output --- IO
-(?i:I/O) --- Input/Output --- I/O
-POD --- Plain Old Documentation
-TDD --- Test-Driven Development
-YAML --- YAML Ain't Markup Language
-JIT --- Just-In-Time
-CPU --- Central Processing Unit
-TCP --- Transmission Control Protocol
-IP --- Internet Protocol
-(?i:JAPH) --- Just Another Perl Hacker --- JAPH
-APL --- A Programming Language
-OS --- Operating Systems
-FBSD --- FreeBSD
-(?i:RGB) --- Red, Green, Blue --- RGB
-JPEG --- Joint Photographic Experts Group
-MPEG --- Moving Picture Experts Group
-JPG --- Joint Photographic Experts Group
-MPG --- Moving Picture Experts Group
-GB --- Gigabyte
-MB --- Megabyte
-KB --- Kilobyte
-(?i:P2P) --- Peer-To-Peer --- P2P
-MS --- Microsoft
-DB --- Database
-TBD --- To Be Done
-HLL --- High-Level Language
-PAUSE --- Perl Authors Upload Server
-DNS --- Domain Name Server
-(?i:poco-irc) --- POE::Component::IRC --- PoCo-IRC
-(?i:pocoirc) --- POE::Component::IRC --- PoCoIRC
-CMS --- Content Management System
-WML --- Wireless Markup Language
-SWIG --- Simplified Wrapper and Interface Generator
-QDOS --- Quick and Dirty Operating System
-QDRDBMS --- Quick and Dirty Relational Database Management System
-CLOS --- Common Lisp Object System
-ORM --- Object-Relational Mapping
-PMC --- Parrot Magic Cookie
-FFI --- Foreign Function Interface
-PDD --- Parrot Design Document
-(?i:DWIM) --- Do What I Mean --- DWIM
-(?i:pugs) --- Perl 6 User's Golfing System --- pugs
-GPL --- GNU General Public License
-LGPL --- GNU Lesser General Public License
-JSP --- JavaServer Pages
-FQDN --- Fully Qualified Domain Name
-IPv6 --- Internet Protocol version 6
-IPv4 --- Internet Protocol version 4
-DSL --- Domain-Specific Language
-SSH --- Secure Shell
-NCI --- Native Call Interface
-CRLF --- Carriage Return/Line Feed
-FLOSS --- Free/Libre/Open-Source Software
-FOSS --- Free/Open-Source Software
-(?i:OSCON) --- O'Reilly Open Source Convention --- OSCON
-(?i:DBC) --- Design By Contract --- DBC
-JVM --- Java Virtual Machine
-PDP --- Personal Data Processor
-ASCII --- American Standard Code for Information Interchange
-GC --- Garbage Collection/Collector
-TCC --- Tiny C Compiler
-IE --- Internet Explorer
-VCS --- Version Control System
-SCM --- Software Configuration Management
-JSON --- JavaScript Object Notation
-DLR --- Dynamic Language Runtime
-GPG --- GNU Privacy Guard
-PGP --- Pretty Good Privacy
-GUI --- Graphical User Interface
-OFTC --- Open and Free Technology Community
-PIL --- Pugs Intermediate Language
-JS --- JavaScript
-yacc --- Yet Another Compiler Compiler
-SIP --- Session Initiation Protocol
-VoIP --- Voice over Internet Protocol
-LAMP --- Linux, Apache, MySQL & Perl
-SBCL --- Steel Bank Common Lisp
-EU::MM --- ExtUtils::MakeMaker
-M::B --- Module::Build
-M::I --- Module::Install
-LLVM --- Low Level Virtual Machine
-RHEL --- Red Hat Enterprise Linux
-PHP --- Pansies Hate Perl
-PAM --- Pluggable Authentication Modules
-OCR --- Optical Character Recognition
-HoH --- Hash of Hashes
-OLED --- Organic Light Emitting Diode
-TT --- Template Toolkit
-CL --- Common Lisp
-PPI --- Perl Parsing Interface
-RC --- Release Candidate
-HTTPS --- Secure Hypertext Transfer Protocol
-PASM --- Parrot assembly language
-GMP --- GNU Multi-Precision Library
-ABNF --- Augmented Backus-Naur Form
-BNF --- Backus-Naur Form
-IDE --- Integrated Development Environment
-SAX --- Simple API for XML
-StAX --- Streaming API for XML
-DOM --- Document Object Model
-SVG --- Scalable Vector Graphics
-XSL --- Extensible Stylesheet Language
-CVS --- Concurrent Versions System
-UML --- Unified Modelling Language
-NYI --- Not Yet Implemented
-LHS --- Left Hand Side
-RHS --- Right Hand Side
-TZ --- Timezone
-SDL --- Simple DirectMedia Layer
-MMD --- Multimethod Dispatch
-HPC --- Haskell Program Coverage
-AJAX --- Asynchronous JavaScript and XML
-CLI --- Command Line Interface
-TLD --- Top-Level Domain
-PCI --- Peripheral Component Interconnect
-USB --- Universal Serial Bus
-RAID --- Redundant Array of Independent Disks
-XSL --- Extensible Stylesheet Language
-XSLT --- Extensible Stylesheet Language Transformations
-CPS --- Continuation Passing Style
-PCT --- Parrot Compiler Toolkit
-red_STD --- Ruby version of STD
View
BIN  bot/cgi/at.png
Deleted file not rendered
View
1  bot/cgi/cgi.conf
@@ -1 +0,0 @@
-BASE_URL = /
View
97 bot/cgi/channel-index.pl
@@ -1,97 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Date::Simple qw(date);
-use CGI::Carp qw(fatalsToBrowser);
-use CGI;
-use HTML::Entities;
-use HTML::Template;
-use Config::File;
-use HTML::Calendar::Simple;
-use Cache::FileCache;
-use lib 'lib';
-use IrcLog qw(get_dbh gmt_today);
-
-my $q = new CGI;
-my $channel = $q->url_param('channel');
-print "Content-Type: text/html; charset=utf-8\n\n";
-
-my $cache_name = $channel . '|' . gmt_today();
-
-my $cache = new Cache::FileCache( {
- namespace => 'irclog',
- } );
-my $data = $cache->get($cache_name);
-if (! defined $data){
- $data = get_channel_index();
- $cache->set($data, '2 hours');
-}
-print $data;
-
-sub get_channel_index {
-
- my $conf = Config::File::read_config_file('cgi.conf');
- my $base_url = $conf->{BASE_URL} || q{/};
- my $t = HTML::Template->new(
- filename => 'template/channel-index.tmpl',
- die_on_bad_params => 0,
- );
-
- my $dbh = get_dbh();
-
- # we are evil and create a calendar entry for month between the first
- # and last date
- my $q3 = $dbh->prepare('SELECT DISTINCT day FROM irclog WHERE channel = ?');
-
-
- $t->param(CHANNEL => $channel);
- $t->param(BASE_URL => $base_url);
- $t->param(CALENDAR => calendar_for_channel($channel, $q3, $base_url));
- return $t->output;
-}
-
-sub calendar_for_channel {
- my ($channel, $query, $base_url) = @_;
- $query->execute('#' . $channel);
- $channel =~ s/\A\#//smx;
- my %cals;
- while (my ($day) = $query->fetchrow_array){
- # extract year and month part: (YYYY-MM)
- my $key = substr $day, 0, 7;
- # day
- my $d = substr $day, 8;
-
- # create calendar
- if (not exists $cals{$key}){
- my ($year, $month) = split m/-/smx, $key;
- $cals{$key} = HTML::Calendar::Simple->new({
- year => $year,
- month => $month,
- });
- }
-
- # populate calendar with links
- $cals{$key}->daily_info({
- day => $d,
- day_link => "$base_url$channel/$day",
- });
- }
-
- # now generate the HTML output
- my $html = q{};
- my $sorter = sub {
- my ($l, $r) = @_;
- return 12 * $cals{$l}->year + $cals{$l}->month
- <=> 12 * $cals{$r}->year + $cals{$r}->month;
- };
-
- for my $cal (reverse sort { &$sorter($a, $b) } keys %cals){
- $html .= qq{\n<div class="calendar">}
- . $cals{$cal}->calendar_month
- . qq{</div>\n}
- }
-
- return $html;
-}
-
-# vim: syn=perl sw=4 ts=4 expandtab
View
11 bot/cgi/channels/.svn/all-wcprops
@@ -1,11 +0,0 @@
-K 25
-svn:wc:ra_dav:version-url
-V 45
-/pugs/!svn/ver/18623/misc/irclog/cgi/channels
-END
-perl6.tmpl
-K 25
-svn:wc:ra_dav:version-url
-V 56
-/pugs/!svn/ver/18623/misc/irclog/cgi/channels/perl6.tmpl
-END
View
41 bot/cgi/channels/.svn/entries
@@ -1,41 +0,0 @@
-8
-
-dir
-21443
-http://svn.pugscode.org/pugs/misc/irclog/cgi/channels
-http://svn.pugscode.org/pugs
-
-
-
-2007-10-24T05:38:29.203094Z
-18623
-moritz
-
-
-svn:special svn:externals svn:needs-lock
-
-
-
-
-
-
-
-
-
-
-
-c213334d-75ef-0310-aa23-eaa082d1ae64
-
-perl6.tmpl
-file
-
-
-
-
-2008-07-23T02:37:56.000000Z
-98d4c88a48e47787b3aaa02fda01a8f3
-2007-10-24T05:38:29.203094Z
-18623
-moritz
-has-props
-
View
1  bot/cgi/channels/.svn/format
@@ -1 +0,0 @@
-8
View
13 bot/cgi/channels/.svn/prop-base/perl6.tmpl.svn-base
@@ -1,13 +0,0 @@
-K 9
-mime-type
-V 9
-text/html
-K 13
-svn:eol-style
-V 6
-native
-K 13
-svn:mime-type
-V 25
-text/plain; charset=UTF-8
-END
View
7 bot/cgi/channels/.svn/text-base/perl6.tmpl.svn-base
@@ -1,7 +0,0 @@
-<p> <a href="http://dev.perl.org/perl6/">Perl 6</a>
- | <a href="http://www.pugscode.org/">Pugs</a>
- | <a href="http://perlcabal.org/syn/?">Specs</a>
- | <a href="http://www.parrotcode.org/">Parrot</a>
- | <a href="http://moritz.faui2k3.org/pugs/">Pugs POD</a>
- | <a href="http://moritz.faui2k3.org/svn-search/">Search the pugs repository logs</a>
-</p>
View
7 bot/cgi/channels/perl6.tmpl
@@ -1,7 +0,0 @@
-<p> <a href="http://dev.perl.org/perl6/">Perl 6</a>
- | <a href="http://www.pugscode.org/">Pugs</a>
- | <a href="http://perlcabal.org/syn/?">Specs</a>
- | <a href="http://www.parrotcode.org/">Parrot</a>
- | <a href="http://moritz.faui2k3.org/pugs/">Pugs POD</a>
- | <a href="http://moritz.faui2k3.org/svn-search/">Search the pugs repository logs</a>
-</p>
View
54 bot/cgi/index.pl
@@ -1,54 +0,0 @@
-#!/usr/bin/perl
-use CGI::Carp qw(fatalsToBrowser);
-use strict;
-use warnings;
-use Config::File;
-use HTML::Template;
-use lib 'lib';
-use IrcLog qw(get_dbh);
-use IrcLog::WWW qw(http_header);
-
-use Cache::FileCache;
-
-print http_header();
-my $cache = new Cache::FileCache( {
- namespace => 'irclog',
- } );
-
-my $data;
-$data = $cache->get('index');
-if ( ! defined $data){
- $data = get_index();
- $cache->set('index', $data, '5 hours');
-}
-print $data;
-
-sub get_index {
-
- my $dbh = get_dbh();
-
- my $conf = Config::File::read_config_file('cgi.conf');
- my $base_url = $conf->{BASE_URL} || q{/irclog/};
-
- my $sth = $dbh->prepare("SELECT DISTINCT channel FROM irclog");
- $sth->execute();
-
- my @channels;
-
- while (my @row = $sth->fetchrow_array()){
- $row[0] =~ s/^\#//;
- push @channels, { channel => $row[0] };
- }
-
- my $template = HTML::Template->new(
- filename => 'template/index.tmpl',
- loop_context_vars => 1,
- global_vars => 1,
- die_on_bad_params => 0,
- );
- $template->param(BASE_URL => $base_url);
- $template->param( channels => \@channels );
-
-
- return $template->output;
-}
View
6 bot/cgi/links.dat
@@ -1,6 +0,0 @@
-p6l --- http://www.nntp.perl.org/group/perl.perl6.language/
-perl6-language --- http://www.nntp.perl.org/group/perl.perl6.language/
-perl6-users --- http://www.nntp.perl.org/group/perl.perl6.users/
-p6c --- http://www.nntp.perl.org/group/perl.perl6.compiler/
-perl6-compiler --- http://www.nntp.perl.org/group/perl.perl6.compiler/
-smop --- http://www.perlfoundation.org/perl6/index.cgi?smop
View
BIN  bot/cgi/moose1.ico
Binary file not shown
View
BIN  bot/cgi/moosecamel.png
Deleted file not rendered
View
211 bot/cgi/out.pl
@@ -1,211 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Carp qw(confess);
-use CGI::Carp qw(fatalsToBrowser);
-use Date::Simple qw(date);
-use Encode::Guess;
-use CGI;
-use Encode;
-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 Cache::SizeAwareFileCache;
-#use Data::Dumper;
-
-
-# Configuration
-# $base_url is the absoulte URL to the directoy where index.pl and out.pl live
-# If they live in the root of their own virtual host, set it to "/".
-my $conf = Config::File::read_config_file('cgi.conf');
-my $base_url = $conf->{BASE_URL} || q{/};
-print http_header();
-
-# I'm too lazy right to move this to a config file, because Config::File seems
-# unable to handle arrays, just hashes.
-
-# map nicks to CSS classes.
-my @colors = (
- ['TimToady', 'nick_timtoady'],
- ['audreyt', 'nick_audreyt'],
- ['evalbot', 'bots'],
- ['exp_evalbot', 'bots'],
- ['p6eval', 'bots'],
- ['lambdabot', 'bots'],
- ['pugs_svnbot', 'bots'],
- ['pugs_svn', 'bots'],
- ['specbot', 'bots'],
- ['speckbot', 'bots'],
- ['pasteling', 'bots'],
- ['rakudo_svn', 'bots'],
- ['purl', 'bots'],
- ['svnbotlt', 'bots'],
- ['dalek', 'bots'],
- );
-# additional classes for nicks, sorted by frequency of speech:
-my @nick_classes = map { "nick$_" } (1 .. 9);
-
-# Default channel: this channel will be shown if no channel=... arg is given
-my $default_channel = 'perl6';
-
-# End of config
-
-my $q = new CGI;
-my $dbh = get_dbh();
-my $channel = $q->param('channel') || $default_channel;
-my $date = $q->param('date') || gmt_today();
-if ($date eq 'today') {
- $date = gmt_today();
-}
-
-
-if ($channel !~ m/\A[\w-]+\z/smx){
- # guard against channel=../../../etc/passwd or so
- confess 'Invalid channel name';
-}
-
-my $count;
-{
- my $sth = $dbh->prepare_cached('SELECT COUNT(*) FROM irclog WHERE day = ?');
- $sth->execute($date);
- $sth->bind_columns(\$count);
- $sth->fetch();
- $sth->finish();
-}
-
-
-{
- my $cache_key = $channel . '|' . $date . '|' . $count;
- # the average #perl6 day produces 100k to 400k of HTML, so with
- # 50MB we have about 150 pages in the cache. Since most hits are
- # the "today" page and those of the last 7 days, we still get a very
- # decent speedup
- # btw a cache hit is about 10 times faster than generating the page anew
- my $cache = new Cache::SizeAwareFileCache( {
- namespace => 'irclog',
- max_size => 150 * 1048576,
- } );
- my $data = $cache->get($cache_key);
- if (defined $data){
- print $data;
- } else {
- $data = irclog_output($date, $channel);
- $cache->set($cache_key, $data);
- print $data;
- }
-}
-
-sub irclog_output {
- my ($date, $channel) = @_;
-
- my $full_channel = q{#} . $channel;
- my $t = HTML::Template->new(
- filename => 'template/day.tmpl',
- loop_context_vars => 1,
- global_vars => 1,
- die_on_bad_params => 0,
- );
-
- $t->param(ADMIN => 1) if ($q->param('admin'));
-
- {
- my $clf = "channels/$channel.tmpl";
- if (-e $clf) {
- $t->param(CHANNEL_LINKS => q{} . read_file($clf));
- }
- }
- $t->param(BASE_URL => $base_url);
- my $self_url = $base_url . "/$channel/$date";
- my $db = $dbh->prepare('SELECT id, nick, timestamp, line FROM irclog '
- . 'WHERE day = ? AND channel = ? AND NOT spam ORDER BY id');
- $db->execute($date, $full_channel);
-
-
-# determine which colors to use for which nick:
- {
- my $count = scalar @nick_classes + scalar @colors + 1;
- my $q1 = $dbh->prepare('SELECT nick, COUNT(nick) AS c FROM irclog'
- . ' WHERE day = ? AND channel = ? AND not spam'
- . " GROUP BY nick ORDER BY c DESC LIMIT $count");
- $q1->execute($date, $full_channel);
- while (my @row = $q1->fetchrow_array and @nick_classes){
- next unless length $row[0];
- my $n = quotemeta $row[0];
- unless (grep { $_->[0] =~ m/\A$n/smx } @colors){
- push @colors, [$row[0], shift @nick_classes];
- }
- }
-# $t->param(DEBUG => Dumper(\@colors));
- }
-
- my @msg;
-
- my $line = 1;
- my $prev_nick = q{};
- my $c = 0;
-
-# populate the template
- my $line_number = 0;
- while (my @row = $db->fetchrow_array){
- my $id = $row[0];
- my $nick = decode('utf8', ($row[1]));
- my $timestamp = $row[2];
- my $message = $row[3];
- next if $message =~ m/^\s*\[off\]/i;
-
- push @msg, message_line( {
- id => $id,
- nick => $nick,
- timestamp => $timestamp,
- message => $message,
- line_number => ++$line_number,
- prev_nick => $prev_nick,
- colors => \@colors,
- self_url => $self_url,
- channel => $channel,
- },
- \$c,
- );
- $prev_nick = $nick;
- }
-
- $t->param(
- CHANNEL => $channel,
- MESSAGES => \@msg,
- DATE => $date,
- );
-
-# check if previous/next date exists in database
- {
- my $q1 = $dbh->prepare('SELECT COUNT(*) FROM irclog '
- . 'WHERE channel = ? AND day = ? AND NOT spam');
- # Date::Simple magic ;)
- my $tomorrow = date($date) + 1;
- $q1->execute($full_channel, $tomorrow);
- my ($res) = $q1->fetchrow_array();
- if ($res){
- my $next_url = $base_url . "$channel/$tomorrow";
- # where the hell does the leading double slash come from?
- $next_url =~ s{^//+}{/};
- $t->param(NEXT_URL => $next_url);
- }
-
- my $yesterday = date($date) - 1;
- $q1->execute($full_channel, $yesterday);
- ($res) = $q1->fetchrow_array();
- if ($res){
- my $prev_url = $base_url . "$channel/$yesterday";
- $prev_url =~ s{^//+}{/};
- $t->param(PREV_URL => $prev_url);
- }
-
- }
-
- return my_encode($t->output);
-}
-
-
-# vim: sw=4 ts=4 expandtab
View
196 bot/cgi/search.pl
@@ -1,196 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use Date::Simple qw(today);
-use CGI::Carp qw(fatalsToBrowser);
-use Encode::Guess;
-use CGI;
-use Encode;
-use HTML::Entities;
-use HTML::Template;
-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;
-
-my $conf = Config::File::read_config_file("cgi.conf");
-my $base_url = $conf->{BASE_URL} || "/";
-my $days_per_page = 10;
-my $lines_per_day = 50; # not yet used
-
-my $lines_of_context = 2;
-
-my $q = new CGI;
-print http_header();
-my $t = HTML::Template->new(
- filename => "template/search.tmpl",
- global_vars => 1,
- die_on_bad_params => 0,
-);
-$t->param(BASE_URL => $base_url);
-my $start = $q->param("start") || 0;
-
-my $offset = $q->param("offset") || 0;
-die unless $offset =~ m/^\d+$/;
-
-my $dbh = get_dbh();
-{
- # populate the select box with possible channel names to search in
- my @channels;
- my $q1 = $dbh->prepare("SELECT DISTINCT channel FROM irclog ORDER BY channel");
- $q1->execute();
- my $ch = $q->param('channel') || 'perl6';
- $ch =~ s/^\#//;
- $t->param(CURRENT_CHANNEL => $ch, CHANNEL => $ch);
- while (my @row = $q1->fetchrow_array){
- $row[0] =~ s/^\#//;
- if ($ch eq $row[0]){
- push @channels, {CHANNEL => $row[0], SELECTED => 1};
- } else {
- push @channels, {CHANNEL => $row[0]};
- }
- }
-
- # populate the size of the select box with channel names
- $t->param(CHANNELS => \@channels);
- if (@channels >= 5 ){
- $t->param(CH_COUNT => 5);
- } else {
- $t->param(CH_COUNT => scalar @channels);
- }
-}
-
-my $nick = decode('utf8', $q->param('nick') || '');
-#my $qs = decode('utf8', $q->param('q') || '');
-my $qs = $q->param('q') || '';
-$qs = my_decode($qs);
-
-
-$t->param(NICK => encode('utf8', $nick));
-$t->param(Q => $qs);
-my $short_channel = decode('utf8', $q->param('channel') || 'perl6');
-# guard against old URLs:
-$short_channel =~ s/^#//;
-my $channel = '#' .$short_channel;
-
-
-if (length($nick) or length($qs)){
-
-
-
- my @sql_conds = ('channel = ? AND NOT spam');
- my @args = ($channel);
- if (length $nick){
- push @sql_conds, '(nick = ? OR nick = ?)';
- push @args, $nick, "* $nick";
- }
- if (length $qs) {
- push @sql_conds, 'MATCH(line) AGAINST(?)';
- push @args, $qs;
- }
- my $sql_cond = 'WHERE ' . join(' AND ', @sql_conds);
-
-# warn $sql_cond;
-# warn join '|', @args;
-
- my $q0 = $dbh->prepare("SELECT COUNT(DISTINCT day) FROM irclog $sql_cond");
- my $q1 = $dbh->prepare("SELECT DISTINCT day FROM irclog $sql_cond "
- . "ORDER BY day DESC LIMIT $days_per_page OFFSET $offset");
- my $q2 = $dbh->prepare("SELECT id, day FROM irclog "
- . $sql_cond . ' AND day = ? ORDER BY id');
- my $q3 = $dbh->prepare('SELECT id, timestamp, nick, line FROM irclog '
- . 'WHERE day = ? AND id >= ? AND id <= ? ORDER BY id ASC');
-
- $q0->execute(@args);
- my $result_count = ($q0->fetchrow_array);
- $t->param(DAYS_COUNT => $result_count);
- $t->param(DAYS_LOWER => $offset + 1);
- $t->param(DAYS_UPPER => min($offset + $days_per_page, $result_count));
-
- my @result_pages;
- my $p = 1;
- for (my $o = 0; $o <= $result_count; $o += $days_per_page){
- push @result_pages, { OFFSET => $o, PAGE => $p++ };
- }
- $t->param(RESULT_PAGES => \@result_pages);
-
- $q1->execute(@args);
- my @days;
- my $c = 0;
-
- my $line_number = 1; # not really needed any more
-
- while (my @row = $q1->fetchrow_array){
-
- # should be smaller than any index in the `id` column:
- my $last_context = -5e10;
-
- my $prev_nick = "";
- my @lines;
- $q2->execute(@args, $row[0]);
- while (my ($found_id, $found_day) = $q2->fetchrow_array){
-
- # determine the context range:
- my $lower = max($last_context + 1, $found_id - $lines_of_context);
- my $upper = $found_id + $lines_of_context;
- $last_context = $upper;
-
- # retrieve context from database
- $q3->execute( $found_day, $lower, $upper );
- while (my @r2 = $q3->fetchrow_array){
- my %args = (
- id => $r2[0],
- nick => decode('utf8', $r2[2]),
- timestamp => $r2[1],
- message => $r2[3],
- line_number => $line_number++,
- prev_nick => $prev_nick,
- colors => [],
- link_url => $base_url . "out.pl?channel=$short_channel;date=$row[0]",
- channel => $channel,
- date => $found_day,
- );
- $args{search_found} = 'search_found' if $r2[0] == $found_id;
-
- push @lines, message_line(
- \%args,
- \$c,
- );
- }
- }
- push @days, {
- URL => $base_url . "out.pl?channel=$short_channel;date=$row[0]",
- DAY => $row[0],
- LINES => \@lines,
- };
- }
- $t->param(DAYS => \@days);
-
-}
-
-print my_encode($t->output);
-#print $t->output;
-
-sub hexdump {
- my $str = shift;
- my $res = q{};
- for (0 .. length($str) - 1){
- $res .= sprintf "%%%x", ord(substr $str, $_, 1);
- }
- return $res;
-}
-
-sub search_with_context {
- my ($q2, $q3) = @_;
- my @ids;
- my $day;
- ($ids[0], $day) = $q2->fetchrow_array();
-
-
-
-}
-
View
64 bot/cgi/spam.pl
@@ -1,64 +0,0 @@
-#!/usr/bin/perl
-use warnings;
-use strict;
-use CGI::Carp qw(fatalsToBrowser);
-use Carp qw(confess);
-use lib '..';
-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();
-
-my @range = sort $q->param("range");
-my @single = $q->param("single");
-
-my $dbh = get_dbh();
-
-my $range_count = scalar @range;
-
-my $d1 = $dbh->prepare("UPDATE irclog SET spam = 1 WHERE id >= ? AND id <= ?");
-my $d2 = $dbh->prepare("UPDATE irclog SET spam = 1 WHERE id = ?");
-
-my $count = 0;
-
-if ($range_count == 2){
- $count += $d1->execute($range[0], $range[1]);
-}
-elsif ($range_count == 0){
- # do nothing
-}
-else {
- confess "Select $range_count 'range' checkboxes, for security reasons only "
- . "two (or zero) are allowed";
-}
-