Want to contribute a botzilla plugin (or core fix?),
just send me an email (at one of the addresses contained in a file header).

Displaying plugin files known to work with the distributed verison of botzilla using no outside classes.
Save these files in your ziggis/ directory and include add them in botzilla.php

alarm, history, sweetass, sed_awk, bookmark, grep, dict_thes, ur, WeatherChan, calZilla, lolcat, babelfish, bzbugtracker, RedSox, sayit
 

alarm

alarm.class.php 2KB 2009-10-15 19:41:34

Unlike native "timed events" that ziggis can have, these alarms send messages at specific times each day or week (or at another interval if you add it).

<?php
/**
* Sound the alarm!
* Message channels or nicks at a specific time of day
*@author bibby <bibby@surfmerchants.com>
*$Id: alarm.class.php,v 1.6 2009/01/12 17:21:58 abibby Exp $
* You are free to do what you wish with this code.
*/

history

history.class.php 1KB 2009-10-15 19:41:33

Keeps a short record for recalling lines, pretty much just for piping it into other functions. The command operator is the caret (^) followed by an integer representing "lines up".


<bbby> that was easy!
<OneTrueDave> sure was
<dot_j> ^2 | .urmom
<botzilla> your mom's easy!

<?php
/**
* Records a breif channel history, and allows ^{int} to recall it. (good for piping)
*@author bibby <bibby@surfmerchants.com>
*$Id: history.class.php,v 1.2 2008/06/10 04:05:48 abibby Exp $
*/

sweetass

sweetass.class.php 0.4KB 2009-10-15 19:41:35

it's rare when it happens, but always funny when it does. (see header)

<?php
/**
http://xkcd.com/37/
@author Dave Gucwa
$Id: sweetass.class.php,v 1.2 2008/06/10 17:06:56 dgucwa Exp $
** //*/

sed, awk, and math

sed_awk.class.php 1.5KB 2009-10-15 19:41:35

We've all seen ppl on IRC occasionally correct their spelling or intention using s/replace/with/ , well now the bot will parse it for you!


<bbby> this is wseet!
<bbby> s/ws/sw/
<botzilla> this is sweet!


Note that this class remembers the last line said (from each channel or nick) so that you can operate on it as ppl tend to do normally on IRC. Also, no command char is necessary here (though it still works). This is good for all sorts of random fun.

<dot_j> I finally got that thing.
<bbby> s/th/f/ | s/\./ering./
<botzilla> I finally got fat fingering.


- - - -
awk is a little trickier, but if you know awk, then it's not so bad.

<bibuntu> one two three four five
<bibuntu> awk {print $5" and-a "$4" and-a "$3" "$2" "$1}
<botzilla> five and-a four and-a three two one


These work well in conjunction with the history and grep plugins as well!

- - -
Finally math (using awk), it's pretty cut and dry.

<bibuntu> .math 7574/34
<botzilla> 222.765
<bibuntu> .math xor(2,6)
<botzilla> 4

<?php
/**
* sed , awk, math
*@author Steve Benz (sed)
*@author bibby (awk, math)
*$Id: sed_awk.class.php,v 1.3 2008/06/13 16:04:15 abibby Exp $
** //*/

bookmarks

bookmark.class.php 2.5KB 2009-10-15 19:41:34

instantly creates permanent commands that accept variables. One line only, though.


<bbby> .bookmark xkcd http://xkcd.com/$1/
<botzilla> added xkcd
<bbby> .xkcd 456
<botzilla> http://xkcd.com/456/


I use these for links to things that people ask about frequently. .unmark {handle} removes the bookmark.

<?php
/**
* class for one-liners, including links, even those that take arguments
* A file PERM_DATA.'bookmarks' keeps the list of lines like handle::text .
* to make use of variables, use $1, $2, etc, and they'll be replaced by Arg(1), Arg(2)
*@author bibby
*$Id: bookmark.class.php,v 1.2 2008/05/31 03:19:34 abibby Exp $
** //*/

grep

grep.class.php 1.2KB 2009-10-15 19:41:34

I'm not a huge fan on how this one works, but I'm providing it as-is because it seems to work ok for us. It depends on the history plugin. For some background, as soon as history hit the scene, we quickly grew tired of counting lines up, so Dave made a history grep, and now it's easy. The thing that I don't like about it is the global $botzilla and the dependency, but meh, it's just a bot.

<?php
/**
* grep
*@author Dave Gucwa
*$Id: grep.class.php,v 1.1 2008/06/13 03:54:34 dgucwa Exp $
***/

dictionary, thesaurus search

dict_thes.class.php 2.1KB 2009-10-15 19:41:33

scrapes reference.com for definitions and synonyms for a supplied term.

<?php
/**
* Search the reference.com family of sites for stuff
( encylopedic .reference was recently removed for being crappy)
.dict {term}
.thes {term}
*@author bibby <bibby@surfmerchants.com>
$Id: dict_thes.class.php,v 1.1 2009-06-05 03:36:33 botzilla Exp $
*/

u, ur, ura, urmom

ur.class.php 2.2KB 2009-10-15 19:41:33

Probably the most used plugin of all time. Trims words off of the last line (or from the pipe) and prepends "you're a" to it, or some variation thereof.

New commands granted are
.u ( "you" )
.ur ( "you're")
.ura ( "you're a")
.urmom ( "your mom's" )
.my ( "I'll show you my" )

They are all used the same way,
.cmd [optional int, words from the back] [optional int, words length] }, Examples are always the best way to explain it:


<bbby> 1 2 3 4 5 6
<bbby> .ura
<botzilla> you're a 6
<bbby> .ur 3
<botzilla> you're 4 5 6
<bbby> .ur 3 2
<botzilla> you're 4 5


more..

<bbby> dot_j, you working tommorrow?
<dot_j> no, I'm taking it off
<bbby> .urmom 3
<botzilla> your mom's taking it off
<dot_j> heh, best feature ever
<bbby> .my 3 2
<botzilla> I'll show you my best feature

<?php
/**
* you're a ___
*@author bibby
*$Id: ur.class.php,v 1.3 2008/06/16 13:39:58 abibby Exp $
** //*/

weather and forecast

WeatherChan.class.php 1.9KB 2009-10-15 19:41:34

This little ziggi fetches the current weather conditions or projected forecast for a US zip code (From the Weather Channel RSS). It has a dependency of a XML Parser. For this, I used one by Manuel Lemos that I got from http://www.phpclasses.org/ and is here

add xml_parser.php to your botzilla/cls/ directory, and the plugin file in botzilla/ziggi/

(11:23:37 AM) bibuntu: .weather
(11:23:38 AM) notzilla: Mostly Cloudy, and 72 ° F.
(11:23:47 AM) bibuntu: .forecast
(11:23:48 AM) notzilla: Today: Partly Cloudy & High 78°F / Low 60°F.
(11:23:48 AM) notzilla: - Sun: Sunny & High 86°F / Low 64°F.
(11:23:49 AM) notzilla: - Mon: Sunny & High 85°F / Low 67°F.
(11:23:58 AM) bibuntu: .forecast 32771
(11:23:59 AM) notzilla: Today: Scattered T-Storms & High 90°F / Low 75°F.
(11:23:59 AM) notzilla: - Sun: Scattered T-Storms & High 91°F / Low 75°F.
(11:24:00 AM) notzilla: - Mon: Scattered T-Storms & High 89°F / Low 78°F.

<?php
/**
* This class featches the current weather and forecast for a zip code from the weather channel's rss
*@author bibby <bibby@surfmerchants.com>
*$Id$
*
*@requires xml_parser.php
*http://www.phpclasses.org/browse/package/4.html
* by Manuel Lemos
* http://www.manuellemos.net/
*/

calZilla

calZilla.class.php 12KB 2009-10-15 19:41:33

Tristan Schneiter made for our office a Google Calendar interface for botzilla (and we use it all the time!). It can view and search multiple calendars, and even add events.
It depends on an open source XML parser (like other ziggis have before), but his choice in that matter was a class by Keith Devens (view license).
Download the dependency here

Each command can take a search term to act as a filter or an argument. Command List:


calsearch
calrange
nexthour
thisafternoon
thismorning
vacation
daysout
tomorrow
comingweek
pastweek
caldate
thisweek
createcalevent
listcals
twodaysbeforetheendofthelastdayofthethirddayofthesecondmonthofnextyear

<?
/**
* calZilla
* Checks Google Calendar for whats happening.
* @author Tristan Schneiter <tristans@surfmerchants.com>
* $Id: calZilla.class.php,v 1.5 2008/08/11
**/

lolcat translator

lolcat.class.php 0.8KB 2009-10-15 19:41:34

Using pipe or history (if available), this plugin translates previous text into lolcat speaking using http://speaklolcat.com/

<?php
/**
* lolcat translation plugin
*@author Dave
*$Id: lolcat.class.php,v 1.1 2008/12/12 17:25:39 dgucwa Exp $
** //*/

babelfish retranslator

babelfish.class.php 1.5KB 2009-10-15 19:41:34

Using pipe or history (if available), this plugin uses yehoo's babel fish to translate english to german, and then back to english in hopes of getting broken english. Corz, you can modify this easily.

<?php
/**
* babelfish translation-and-retranslation plugin
*@author Dave
*$Id: babelfish.class.php,v 1.1 2008/12/15 19:30:56 dgucwa Exp $
** //*/

Bug Tracker

bzbugtracker.class.php 7.2KB 2009-10-15 19:41:34

A simple bug tracking/assignment plugin to help (me) track (botzilla's) bugs. Using JSON for storage, you may want (or need) to use a parser. For php4 environments, I like and recommend Services_JSON from PEAR-land http://pear.php.net/pepr/pepr-proposal-show.php?id=198

<?php
/**
* botzilla bug tracker
*@author bibby
*$Id: bzbugtracker.class.php,v 1.1 2009/01/11 17:57:27 abibby Exp $

Commands

addBug {bug text} # adds a bug item, assigned to you
assignBug {bug#} {toPerson=you} # assigns a bug to a person
deleteBug {bug#} # completely removes a bug item
bugStatus {bug#} {toStatus#} # sets a status to a bug. Provide no args to get a list of statuses
bugText {bug#} {new bug text} # sets the description of the bug
closeBug {bug#} # sets a bug status to Resolved
showBug {bug#} # prints the bug data
openBugs # prints open bug tickets
** //*/

RedSox scores and games

RedSox.class.php 3.6KB 2009-10-15 19:41:35

Fetches mlb's json to keep your channel in the know.

<?php
/**
* Let's go Red Sox!
*@author bibby <bibby@surfmerchants.com>
$Id: RedSox.class.php,v 1.2 2009/04/24 18:10:18 abibby Exp $
** //*/

sayIt

sayit.class.php 0.9KB 2009-10-15 19:41:33

a command line bridge to messaging

<?php
/**
* CLI interface for messaging
* usage::
* echo -e "testing \n1 \n2" >> ~/botzilla/sayit/\#botzilla
*@author bibby <bibby@botzilla.org>
*$Id: sayit.class.php,v 1.4 2009/06/20 15:17:26 abibby Exp $
*/