This is a version of GitHub's Campfire bot, hubot, customized for Flat World Knowledge.
This version is designed to be deployed on Heroku. Flatbot is on heroku at http://flatbot.herokuapp.com/ but you won't find any web presence.
You will need to install Redis (http://jasdeep.ca/2012/05/installing-redis-on-mac-os-x/) before you can run Flatbot locally. Some local
export [email protected]
export [email protected]
export HUBOT_FLOWDOCK_LOGIN_PASSWORD=pepper123
You can test flatbot by running the following. Note that we use the Flowdock adapter.
% bin/hubot -a flowdock -n flatbot
You'll see some start up output about where your scripts come from and a prompt.
[Sun, 04 Dec 2011 18:41:11 GMT] INFO Loading adapter shell
[Sun, 04 Dec 2011 18:41:11 GMT] INFO Loading scripts from /home/tomb/Development/hubot/scripts
[Sun, 04 Dec 2011 18:41:11 GMT] INFO Loading scripts from /home/tomb/Development/hubot/src/scripts
Hubot>
Then you can interact with flatbot by typing flatbot help
.
Hubot> flatbot help
Hubot> animate me <query> - The same thing as `image me`, except adds a few
convert me <expression> to <units> - Convert expression to given units.
help - Displays all of the help commands that Hubot knows about.
...
Take a look at the scripts in the ./scripts
folder for examples.
Delete any scripts you think are useless or boring. Add whatever functionality you
want flatbot to have. Read up on what you can do with hubot in the Scripting Guide.
If you are going to use the redis-brain.coffee
script from hubot-scripts
(strongly suggested), you will need to add the Redis to Go addon on Heroku which requires a verified
account or you can create an account at Redis to Go and manually
set the REDISTOGO_URL
variable.
% heroku config:add REDISTOGO_URL="..."
If you don't require any persistence feel free to remove the
redis-brain.coffee
from hubot-scripts.json
and you don't need to worry
about redis at all.
We use the persistence with Flatbot (why not?), so you'll need to run a redis-server locally if you want to test locally.
There will inevitably be functionality that everyone will want. Instead of adding it to hubot itself, you can submit pull requests to hubot-scripts.
To enable scripts from the hubot-scripts package, add the script name with
extension as a double quoted string to the hubot-scripts.json
file in this
repo.
Tired of waiting for your script to be merged into hubot-scripts
? Want to
maintain the repository and package yourself? Then this added functionality
maybe for you!
Hubot is now able to load scripts from third-party npm
packages! To enable
this functionality you can follow the following steps.
- Add the packages as dependencies into your
package.json
npm install
to make sure those packages are installed
To enable third-party scripts that you've added you will need to add the package
name as a double quoted string to the external-scripts.json
file in this repo.
You'll need to have access to the flatbot heroku instance, and add it as a remote:
% heroku git:remote -a flatbot
Then:
% git push heroku master
% heroku ps:scale web=1
If you run into any problems, checkout Heroku's docs.
More detailed documentation can be found on the deploying hubot onto Heroku wiki page.
You may want to get comfortable with heroku logs
and heroku restart
if you're having issues.