wikipedia: U: wiki <topic>
wikipedia: E: wiki irc
+wtf: D: Interface to the BSD wtf command
+wtf: U: ## <abbreviation>
+wtf: E: ## iirc
+
-host: D: admin command to remove hostmask from a user account
-host: U: ## [user] <mask>
-host: E: ## *!*@owns.org
-#v1: blootbot -- blootbot -- written Thu Dec 9 21:27:25 2004
+#v1: blootbot -- infobot -- written Thu Feb 17 02:56:42 2005
#botpark
+RootWarn
+slashdot
+spell
+tell
+ +wtf
+zfi
+zsi
&addCmdHook("extra", '(babel(fish)?|x|xlate|translate)', ('CODEREF' => 'babelfish::babelfish',
'Identifier' => 'babelfish', 'Cmdstats' => 'babelfish',
'Forker' => 1, 'Help' => 'babelfish') );
+&addCmdHook("extra", 'wtf', ('CODEREF' => 'wtf::query',
+ 'Identifier' => 'wtf', 'Cmdstats' => 'wtf',
+ 'Forker' => 1, 'Help' => 'wtf') );
###
### END OF ADDING HOOKS.
###
--- /dev/null
+#
+# wtf.pl: interface to bsd wtf
+# Author: Tim Riker <Tim@Rikers.org>
+# Source: modified from jethro's patch
+# Licensing: Artistic License (as perl itself)
+# Version: v0.1
+#
+# Copyright (c) 2005 Tim Riker
+#
+
+package wtf;
+
+use strict;
+
+sub wtf::wtf {
+ my $query = shift;
+ my $binary;
+ my @binaries = (
+ '/usr/games/wtf',
+ '/usr/local/bin/wtf'
+ );
+ foreach (@binaries) {
+ if (-x $_) {
+ $binary=$_;
+ last;
+ }
+ }
+ if (!$binary) {
+ return("no binary found.");
+ }
+ if ($query =~ /^$|[^\w]/){
+ return("usage: wtf <foo>.");
+ }
+ if (!&main::validExec($query)) {
+ return("argument appears to be fuzzy.");
+ }
+
+ my $reply ="";
+ foreach (`$binary '$query' 2>&1`){
+ $reply .= $_;
+ }
+ $reply =~ s/\n/ /;
+ chomp($reply);
+ return($reply);
+}
+
+sub wtf::query {
+ &::performStrictReply(&wtf(@_));
+ return;
+}
+
+1;
+# vim: ts=2 sw=2