Ybot - is chat robot written with erlang programming language. It is seats in the chat room and waits incoming messages from other chat users. When Ybot receive message, it try to parse it and after successful parsing it executes his plugin which depends on incoming message. Plugin is just executable script on python, perl, ruby or shell programming language. Ybot's plugins can be varied, from google search to get github site status, from calculating math expressions to get hacker news and etc etc...
In this post i try to descibe all in one place how to install Ybot, configure and use it.
Main Ybot repostiory is at github - Ybot. You can get it with difference methods. You can get it via git:
git clone git://github.com/0xAX/Ybot.git
Or you can download zip or tar.gz version. When you have downloaded you Ybot now you must get it's dependencies and build it from source with:
./rebar get-deps && ./rebar compile
After successful compiling we can configure it.
Before Ybot starting we must configure it for your needs. Here i try to descibe all Ybot's configuration parameters. First
of all open ybot.config file from Ybot's root directory. This is main and only one configuration file. It holds all Ybot's
configuration. ybot.config - is just file with erlang programming language syntax. All strings after % symbol are comments
and it's ignored. Let's see how to configure Ybot for different transports. Transport in Ybot is just chat type which Ybot
supports. At that moment Ybot supports following transports:
You can configure Ybot on http supporting. It can receive data via http and send response. Example of Ybot http configuration:
You must just put host and port parameters to configuration file.
You can configure Ybot on xmpp supporting. It can receive data via xmpp and send response to chat. It supports as single user chat, as multi use chat. Example of Ybot xmpp configuration:
Here you must put five standard jabber options to config as: jabber id, jabber room and etc... Since Gtalk works under xmpp/ssl, if you want use Ybot for Gtalk communication, you must just set following connection options into config:
{use_ssl, true}{port, 443}HipChat works via xmpp too. If you want use Ybot for HipChat communication, just configure it for Hipchat:
It's simple. Little note about hipchat_nick. You must get it in the xmpp settings in your HipChat account page.
Ybot supports also campfire chat from 37signals. Here example of configuration file for campfire chat:
You must put: campfire login, access token which you can get into campfire account page, campfire room id and sub domain of your campfire room.
You also can use Ybot with Flowdock chat. Here is configuration file for flowdock:
Just put Ybot's flowdock login/password and flowdock data as flowdock organization and flow.
Irc :) Irc was first chat which Ybot supports. Ybot configuration example for irc:
You must put Ybot login, channell and server information. Also you can use it via ssl.
Ybot's configuration file holds also some parameters. Let's look on it:
{checking_new_plugins, false} and {checking_new_plugins_timeout, 60000} - if checking_new_plugins equal true, Ybot with
checking_new_plugins_timeout checks plugins directory for new plugins and if found they're will be loaded.{commands_history, false} and {history_command_limit_count, 1000} - if commands_history parameters set in true, Ybot will
save all incoming messages and will show you by receiving history command in chat.I added skype support for Ybot, and here i describe hot to configure Ybot for using with skype. First of all i must say, that there is very primitive skype support in Ybot. There is python script - skype.py which you can find here, which uses skype api for works with skype. Also if you want to use Ybot with skype, it depends on Skype4Py library, which you can install with:
pip install Skype4Py
or download source code and
python setup.py install
skype.py script receives skype messages and sends it to Ybot via http, got response from Ybot and sends it back to skype, all simple.
After Ybot configuring, you must configure your skype. Open /etc/dbus-1/system.d/skype.conf and add:
After skype configuring, you must have run skype in the same machine as Ybot. Now configure Ybot. We must run http interface and skype interface in Ybot:
Here we can see that we start skype and http transport. Now we can add to skype contact list our robot and send to it messages.
Ybot supports also talkerapp chat. Ybot configuration for using with talkerapp:
After Ybot configuring, you can run Ybot with:
./start.sh
Also you can deploy at Heroku. Go to the Ybot's root directory and execute:
heroku create your-application-name -s cedar heroku config:add BUILDPACK_URL=http://github.com/heroku/heroku-buildpack-erlang.git git push heroku master
Every Ybot's command is plugin. Plugin is just executable script on python, perl, ruby or shell programming language. Ybot's plugins can be varied, from google search to get github site status, from calculating math expressions to get hacker news and etc etc... There are some simple rules how to write Ybot plugin:
Ybot.math or ping. Every command consists from one word.plugins directory.Ybot ping command, we must have a plugin
named ping.py or ping.rb or ping.shell, etc.STDOUT in the end.You can find core plugins here.
Ybot is open source project and you can help to develop it. All parts of Ybot, Ybot core, Ybot transport, Ybot plugins are open. You can:
Fork Ybot at github, star it, or tell about Ybot to your friends.
Some usefule links: