This is an early idea. It doesn't work yet
This is your personal Reddit robot. He's a cool dude. His big brother is Hubot, who is also cool.
You'll probably never have to hack on this repo directly.
Instead this repo provides a library that's distributed by npm
that you
simply require in your project. Follow the instructions below and get your own
karmabot ready to deploy.
Make sure you have node.js and npm (npm comes with node v0.6.5+) installed.
Download the latest version of karmabot.
Then follow the instructions in the README in the extracted karmabot
directory.
karmabot has a HTTP listener which listens on the port specified by the PORT
environment variable.
You can specify routes to listen on in your scripts by using the router
property on robot
.
module.exports = (robot) ->
robot.router.get "/karmabot/version", (req, res) ->
res.end robot.version
There are functions for GET, POST, PUT and DELETE, which all take a route and callback function that accepts a request and a response.
Install all of the required dependencies by running npm install
.
It's easy to test scripts locally with an interactive shell:
% export PATH="node_modules/.bin:$PATH"
% bin/karmabot
... and to run unit tests:
% make test