]> git.donarmstrong.com Git - infobot.git/blobdiff - src/CommandStubs.pl
el too
[infobot.git] / src / CommandStubs.pl
index bdcaf0b107ed940672bbf059d0aac74331d4cfd6..261da67e877c482d2b7272dd6b022845931b4741 100644 (file)
@@ -3,7 +3,8 @@
 # WARN: this file does not reload on HUP.
 #
 
-# use strict;  # TODO
+# TODO:
+# use strict;
 
 use vars qw($who $msgType $conn $chan $message $ident $talkchannel
        $bot_version $babel_lang_regex $bot_data_dir);
@@ -13,12 +14,12 @@ use vars qw(%channels %cache %mask %userstats %myModules %cmdstats
 # FIX THE FOLLOWING:
 use vars qw($total $x $type $i $good);
 
-$babel_lang_regex = "fr|sp|es|po|pt|it|ge|de|gr|en|zh|ja|jp|ko|kr|ru";
+$babel_lang_regex = "de|ge|gr|el|sp|es|en|fr|it|ja|jp|ko|kr|nl|po|pt|ru|zh|zt";
 $w3search_regex   = "google";
 
 ### COMMAND HOOK IMPLEMENTATION.
 # addCmdHook("SECTION", 'TEXT_HOOK',
-#      (CODEREF        => 'Blah', 
+#      (CODEREF        => 'Blah',
 #      Forker          => 1,
 #      CheckModule     => 1,                   # ???
 #      Module          => 'blah.pl'            # preload module.
@@ -190,7 +191,7 @@ sub parseCmdHook {
        'Forker' => 1, 'Identifier' => 'kernel',
        'Cmdstats' => 'Kernel', 'NoArgs' => 1) );
 &addCmdHook("extra", 'listauth', ('CODEREF' => 'CmdListAuth',
-       'Identifier' => 'search', Module => 'factoids', 
+       'Identifier' => 'search', Module => 'factoids',
        'Help' => 'listauth') );
 &addCmdHook("extra", 'quote', ('CODEREF' => 'Quote::Quote',
        'Forker' => 1, 'Identifier' => 'quote',
@@ -231,6 +232,9 @@ sub parseCmdHook {
 &addCmdHook("extra", 'bzflist', ('CODEREF' => 'BZFlag::list',
        'Identifier' => 'bzflag', 'Cmdstats' => 'BZFlag',
        'Forker' => 1) );
+&addCmdHook("extra", 'bzflist17', ('CODEREF' => 'BZFlag::list17',
+       'Identifier' => 'bzflag', 'Cmdstats' => 'BZFlag',
+       'Forker' => 1) );
 &addCmdHook("extra", 'bzfquery', ('CODEREF' => 'BZFlag::query',
        'Identifier' => 'bzflag', 'Cmdstats' => 'BZFlag',
        'Forker' => 1, 'Help' => 'bzflag') );
@@ -251,7 +255,9 @@ sub parseCmdHook {
 &addCmdHook("extra", 'httpdtype', ('CODEREF' => 'HTTPDtype::HTTPDtype',
        'Identifier' => 'httpdtype', 'Cmdstats' => 'httpdtype',
        'Forker' => 1) );
-
+&addCmdHook("extra", 'rss', ('CODEREF' => 'Rss::Rss',
+       'Identifier' => 'rss', 'Cmdstats' => 'rss',
+       'Forker' => 1, 'Help' => 'rss') );
 ###
 ### END OF ADDING HOOKS.
 ###
@@ -850,7 +856,7 @@ sub do_text_counters {
     if (!defined $arg or $arg =~ /^\s*$/) {
        # this is way fucking ugly.
 
-       # TODO convert $where to hash
+       # TODO: convert $where to hash
        my %hash = &sqlSelectColHash("stats", "nick,counter",
                        { },
                        $where." ORDER BY counter DESC LIMIT 3", 1
@@ -878,7 +884,7 @@ sub do_text_counters {
            &pSReply("zero counter for \037$type\037.");
        }
     } else {
-       # TODO convert $where to hash and use a sqlSelect
+       # TODO: convert $where to hash and use a sqlSelect
        my $x = (&sqlRawReturn("SELECT SUM(counter) FROM stats".
                        " WHERE $where AND nick=".&sqlQuote($arg) ))[0];
 
@@ -888,7 +894,7 @@ sub do_text_counters {
        }
 
        # defined.
-       # TODO convert $where to hash
+       # TODO: convert $where to hash
        my @array = &sqlSelect("stats", "nick", undef,
                        $where." ORDER BY counter", 1
        );
@@ -962,7 +968,7 @@ sub textstats_main {
        return;
     }
 
-    # TODO add nick to where_href
+    # TODO: add nick to where_href
     my %hash = &sqlSelectColHash("stats", "type,counter",
                $where_href, " AND nick=".&sqlQuote($arg)
     );
@@ -975,7 +981,7 @@ sub textstats_main {
     foreach (keys %hash) {
        &DEBUG("_stats: hash{$_} => $hash{$_}");
        # ranking.
-       # TODO convert $where to hash
+       # TODO: convert $where to hash
        my @array = &sqlSelect("stats", "nick", undef,
                $where." ORDER BY counter", 1);
        $good = 0;
@@ -1009,7 +1015,11 @@ sub textstats_main {
     &pSReply("\002$arg\002 has said \037$type\037 \002$x\002 times (\002$pct1\002 %)$xtra");
 }
 
-sub nullski { my ($arg) = @_; return unless (defined $arg);
-       foreach (`$arg`) { &msg($who,$_); } }
+sub nullski {
+    my ($arg) = @_;
+    return unless (defined $arg);
+    # big security hole
+    #foreach (`$arg`) { &msg($who,$_); }
+}
 
 1;