WikiBot

This is my little way of searching through wikipages from IRC using eggdrop

a bash script:

tempfile="wikisearch.tmp"
 * 1) /bin/bash

echo "`grep -i -R -l -h $1 /var/www/wiki/page/* | cut -d/ -f7 | cut -d. -f1`" > $tempfile wcount=`less $tempfile | wc -l` echo "Found '$1' in $wcount wiki pages. Outputting 1 random hit: http://wiki.s23.org/wiki.pl?`rl -c1 $tempfile` Find the rest on http://wiki.s23.org/wiki.pl?search=$1&dosearch=Go!"

and a tcl script:

bind pub - !wiki wiki10

proc wiki10 {nick host hand chan text} { set data10 [exec bash -c "/home/kallisti/egg/scripts/wiki.sh $text"]; putlog "$data10"; regsub -all { } $data10 {} data11; putserv "PRIVMSG $chan :$data11";

}

Now you can do a:

!wiki on any channel with "Kallisti".

Example:

<@mutante> !wiki mutante

<@Kallisti> Found 'mutante' in 195 wiki pages. Outputting 1 random hit: http://wiki.s23.org/wiki.pl?InterFace