Skip to content

tokyor/mecamonagi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mecamonagi - A Docker Image for hubot that can talk R

Note that the heart of this hubot is made by @teramonagi. Thanks for your great work!

Pull

hubot-rserve Docker image is now on Docker Hub: https://registry.hub.docker.com/u/tokyor/mecamonagi/

docker pull tokyor/mecamonagi

Run

1. Configure Hubot Integration

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.

2. Run Docker Container

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

3. Talk To Hubot

This hubot can execute arbitrary R scripts like this:

r! summary(lm(speed~dist,data=cars)) 

The hubot answers immediately like this:

screen

Available Commands

Exec Script
r! COMMAND
Plot
plot! COMMAND
Get Weather Forecast
weather! LOCATION

Development

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

About

A docker image of R bot for slack

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published