Hubot
Intro
Hubot is a chat-bot written by the folks at GitHub. It is a node.js application written in CoffeeScript.
Hubot has a variety of adapters that allow it to connect to a variety of chat platforms. These range from IRC to Slack. So, the platform
you are interested in probably already has an adapter available for it.
Hubot uses individual CoffeeScript scripts to provide chat-bot functionality. There are a slew of existing scripts available in the npm. Just search for hubot-scripts.
You can also write your own in order to make sure that Hubot provides the functionality that you need.
Install
Hubot is available as an npm package. So, you will need to install node.js and npm on your system. I will leave this as an exercise for the listener.
I will however, throw out a tip for those of you using a Raspberry Pi for this. The node.js platform should be deployed on an ARM system using the armhf (ARM hard float) architecture. The nod
e.js stack needed to run Hubot will not properly install if you are using the armel (ARM soft float) architecture.
Once you have node.js and npm installed, you can install hubot and its dependencies with the following command.
npm install -g hubot yo generator-hubot coffee-script
You create your own instance of hubot by using yeoman generator. You need to do this as a non-root user. When you create your bot, you will give it a name and
specify the adapter to use. These can be specified as command line flags, or the generator will prompt you for this information.
Owner
Name
Description
Adapter
Interactive
yo hubot
Providing the answers
yo hubot --name mybot --description "My Helpful Robot" --adapter shell --defaults
Running
Once hubot is installed, you can run it with the following. I will use the shell adapter, which provides an interactive shell from which to trigger hubot scripts.
./bin/hubot --adapter shell
Our Hubot instance is now active and ready to receive commands. We will start with a simple ping command.
mybot> mybot ping
mybot> PONG
We can see the available commands by asking Hubot for help
mybot> mybot help
mybot adapter - Reply with the adapter
mybot animate me <query> - The same thing as `image me`, except adds a few parameters to try to return an animated GIF instead.
mybot echo <text> - Reply back with <text>
mybot help - Displays all of the help commands that Hubot knows about.
mybot help <query> - Displays all help commands that match <query>.
mybot image me <query> - The Original. Queries Google Images for <query> and returns a random top result.
mybot map me <query> - Returns a map view of the area returned by `query`.
mybot mustache me <url|query> - Adds a mustache to the specified URL or query result.
mybot ping - Reply with pong
mybot pug bomb N - get N pugs
mybot pug me - Receive a pug
mybot the rules - Make sure hubot still knows the rules.
mybot time - Reply with current time
mybot translate me <phrase> - Searches for a translation for the <phrase> and then prints that bad boy out.
mybot translate me from <source> into <target> <phrase> - Translates <phrase> from <source> into <target>. Both <source> and <target> are optional
ship it - Display a motivation squirrel
We will t