Note that the heart of this hubot is made by @teramonagi. Thanks for your great work!
hubot-rserve Docker image is now on Docker Hub: https://registry.hub.docker.com/u/tokyor/mecamonagi/
docker pull tokyor/mecamonagi
You can configure the intagration here: https://YOURTEAM.slack.com/services/new/hubot
You will find "API Token", which you will use on the next step.
In addition to a Slack Hubot API token, you need an Slack Web API tokan to upload images. (bot cannot use file upload API)
docker run -d \
-e HUBOT_SLACK_TOKEN=XXXXXXXXXX \
-e SLACK_WEB_API_TOKEN=YYYYYYYYY \
tokyor/mecamonagi
This hubot can execute arbitrary R scripts like this:
r! summary(lm(speed~dist,data=cars))
The hubot answers immediately like this:
r! COMMAND
plot! COMMAND
weather! LOCATION
docker run --user=root -t -i tokyor/mecamonagi /bin/bash
# Inside the hubot-rserve container ----------------
# customize the heart of mecamonagi
vi scripts/mecamonagi.coffee
# add some script
vi scripts/some-awesome-script.coffee
# run Rserve
R CMD Rserve --vanilla
# run hubot
HUBOT_SLACK_TOKEN=XXXXXXXXXX SLACK_WEB_API_TOKEN=YYYYYYYY bin/hubot -a slack