A fun hack that gets Slackbot to force your teammates to work out!
-
Clone the repo and navigate into the directory in your terminal.
$ git clone [email protected]:mgyucht/slackbot-workout.git
-
Go to your slack home page https://{yourgroup}.slack.com/home & click on Integrations on the left sidebar.
-
Scroll All the Way Down until you see Slack API and Slackbot. You'll need to access these two integrations.
-
In the Slack API Page, select WebAPI in the left side bar, scroll all the way down, and register yourself an auth token. You should see this. Take note of the token, e.g.
xoxp-2751727432-4028172038-5281317294-3c46b1
. This is your User Auth Token -
Set up channel and customize configurations
Copy
default.yaml
ordefault.json
and configure to your heart's desire. There are a handful of sample configurations located in thesamples/
directory. -
While in the project directory, run
$ sudo ./install-dependencies.sh $ sudo pip install -r requirements.txt $ python -m samples.flexbot
Run the script to start the workouts and hit ctrl+\ to stop the script. Hope you have fun with it!
Alternatively to running the source directly, my Docker hub page for flexbot is linked to the current version on the hackathon
branch. This should simplify the setup substantially. In order to run this docker container, you need to bind mount the configuration and logging configuration into the /flexbot/configuration
directory in the container. Additionally, you'll need to set up the port mapping for whatever port you have specified the web server to run on.
-
Run
docker pull yucht/flexbot:latest
to get the most recent version from the registry. -
Run
docker run -v <config_file>:/flexbot/configuration/config.yaml \ -v <logging_config_file>:/flexbot/configuration/logging.yaml \ -d -p 80:80 -t yucht/flexbot:latest
where <config_file> is your flexbot configuration and <logging_config_file> is your logging configuration to start running flexbot.
To ease development, this docker container also exposes port 8080, so if you want to run a development version for testing and a production version simultaneously, you can simply bring up your webserver on port 8080 and run a production container and a development one simultaneously.
Currently, you can specify two configuration files, one which controls the behavior of slackbot, and the other which controls the behavior of the loggers in slackbot. The samples.flexbot
module currently defaults to using config.yaml
and logging.yaml
in the current working directory, but you can specify alternate configuration files by using --config
and --logging-config
respectively. Slackbot can read both YAML and JSON files for the configuration files and exercise files.