/
index.html
142 lines (130 loc) · 5.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head profile="http://gmpg.org/xfn/11">
<title>whistler - the whistler bot </title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="imagetoolbar" content="no" />
<link href="http://fonts.googleapis.com/css?family=Raleway:100" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="styles/default.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
<script src="scripts/jquery.smothscroll.js" type="text/javascript"></script>
<script type="text/javascript">$(function(){$("a[href^=\#]").smoothScroll();});</script>
</head>
<body>
<div id="fadeout"></div>
<div id="flybar">
<a id="logo" href="#top"> </a>
<div class="navigation">
<div class="button">
<a href="#install">Install</a>
</div>
</div>
<div class="navigation">
<div class="button">
<a href="#usage">Usage</a>
</div>
</div>
<div class="navigation">
<div class="button">
<a href="#extend">Extend</a>
</div>
</div>
<div class="navigation">
<div class="button">
<a href="#contrib">Contrib</a>
</div>
</div>
<div class="navigation">
<div class="button">
<a href="https://github.com/ajdiaz/whistler/tree/master/whistler/mixins">Mixins</a>
</div>
</div>
<div class="navigation">
<div class="button">
<a href="http:///github.com/ajdiaz/whistler">Fork me on Github!</a>
</div>
</div>
</div>
<div id="topall">
<div class="box"></div>
</div>
<div id="content" class="container">
<h1>The Whistler Bot</h1>
<p><a id="download" href="https://github.com/ajdiaz/whistler/tarball/v1.0">Download v1.0 (stable)</a></p>
<p>The Whistler bot is another jabber bot with <acronym title="Multi-User Chat">MUC</acronym> support,
<strong>designed to be easy to extend</strong>, and it's built on the top of the
<a href="https://github.com/fritzy/SleekXMPP/wiki">SleekXMPP</a> library.</p>
<p>Whistler is a generic framework to build MUC bots. The MUC rooms are the new
<acronym title="Internet Relay Chat">IRC</acronym> channels. Although exists
many differences and, of course, many people still prefer the old and good
IRC channel, the true is that the MUC rooms offers a number of new
posibilities and utilities.</p>
<p>Whistler works using <strong>mixins</strong>. The mixins implements a bot
<em>personality</em>, and of course you can mix a number of mixins. Sounds cool eh?!</p>
<h2><a id="install" href="#install" class="headerlink">Installation</a></h2>
<p>Whistler is written in <strong>python</strong>, so you need almost a 2.7 version of python
and the <a href="https://github.com/fritzy/SleekXMPP/wiki">SleekXMPP</a>
library (which is installed as dependency).</p>
<p>Whistler has an entry in <a href="http://pypi.python.org/pypi/whistler/">pypi</a>,
so you can install whistler using <a href="http://pypi.python.org/pypi/pip">pip</a>
or <a href="http://pypi.python.org/pypi/setuptools">setuptools</a>:</p>
<pre>$ pip install whistler
$ easy_install whistler</pre>
<h2><a id="usage" href="#usage" class="headerlink">Usage</a></h2>
<p>The bot is designed to work in foreground, you can use
process monitoring tool to keep it running in background,
like runit, daemontools or dmon.</p></p>
<p>To start the bot create a config file with required data,
usually you need a server to connect to, a port, an username
and a password, and of course a MUC channel to join in. The
example config file is self explanatory.</p></p>
<p>To start the bot just type:</p>
<pre>whistler <em>config.file</em></pre>
<p>Whistler is designed to be modular, once the bot is started without load any mixin,
bot does nothing. Its a zombie without will.</p>
<p>Mixins give personality to the bot, so loading the <code>log</code> mixin
converts the zombie bot into a logger bot; loading the <code>help</code>
mixin gives the bot the ability of know itself and so on.</p>
<p>There are a list of mixins, but you can easy create new one.</p>
<p>To load a mixin just type in the config file an entry
like that:</p>
<pre>
[mixin:<em>mixin_name</em>]
<em>optional_properties</em>
</pre>
<h2><a id="extend" href="#extend" class="headerlink">Extend</a></h2>
<p>The real power of Whistler is the abaility to be
extended. With mixins you can give to your bot
a unique function or personality, and you can create
easily new commands.</p>
<p>To create new mixin just create a new python file in
<code>mixins/</code> directory, and put there a new
class (none parent class is required). Any method which
starts with "cmd_" prefix will be threated as a bot
command. For example just type a single mixin which give
us the current date, so we create the file <code>givemedate.py</code>:</p>
<pre>
import datetime
class DateMixin(object):
def cmd_givemedate(self, cmd, args):
now = datetime.datetime.now()
return now.strftime("%Y-%m-%d %H:%M")
</pre>
<p>Now just edit your config file and add the mixin:</p>
<pre>[mixin:givemedate]</pre>
<p>Now you can run the bot and enjoy your new command! That's easy, innit?</p>
<h2><a id="contrib" href="#contrib" class="headerlink">Contribute</a></h2>
<p>The main code is store on github, so you can clone it and make your changes
as git usual way:</p>
<pre>git clone git://github.com/ajdiaz/whistler</pre>
<p>Also, bug reports/fixes, enhancements proposals, new mixins or, in general,
any comment about the bot are welcome.</p>
<p>Happy botting! :)</p>
<div style="clear:both;"></div>
</div>
<div id="footer">
<p>Web design based on <a href="http://jashkenas.github.com/coffee-script/">coffe-script web site</a>.</p>
</div>
</body>
</body>