-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9509f95
commit 73ab2e1
Showing
1 changed file
with
19 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
# slackcloud | ||
|
||
**slackcloud** generates word clouds using Slack chat history. This application runs on a server that is reachable by Slack. It is designed to be triggered by a Slack "Slash Command" that you set up. It listens for the trigger from the "Slash command" and then grabs the history from the Slack channel it was called from. Then it generates a word cloud and uploads it to the same channel. | ||
**slackcloud** generates word clouds using Slack chat history | ||
|
||
This application runs on a server that is reachable by Slack. It is triggered by a Slack "Slash Command". After receiving the POST from Slack it then grabs the history from the Slack channel it was called from. From that history (100 words), it generates a word cloud and uploads it to the same channel. | ||
|
||
## Requirements | ||
|
||
- Slack | ||
- Ubuntu or Mac OSX | ||
- Python 2.7 | ||
|
||
## Quickstart | ||
|
||
1. Set up your custom slash command under the Slack "Custom Integrations" tab. This is the command you will use to kick off a word cloud. | ||
2. Create your custom Bot under the Slack "Custom Integrations". This bot is the user that will upload the word cloud picture. | ||
3. In your environment, add the following environment variables. For Mac OSX, use **~/.bash_profile**. For Ubuntu, use **~/.bash_aliases**. | ||
|
||
- `git clone [email protected]/jasonrhaas/slackcloud` on your webserver. | ||
- Create a custom slash command under the Slack "Custom Integrations" tab. This is the command you will use to kick off a word cloud. Configure the command to point towards the webserver that you will be hosting **slackcloud** on. | ||
- Create a custom Bot under the Slack "Custom Integrations" tab. This bot is the user that will upload the word cloud picture. | ||
- In your environment, add the following environment variables. For Mac OSX, use **~/.bash_profile**. For Ubuntu, use **~/.bash_aliases**. | ||
|
||
``` | ||
# Slack bot token | ||
|
@@ -19,17 +29,16 @@ export SLACK_CMD1_NAME='xxxx' | |
export SLACK_CMD1_TOKEN='xxxx' | ||
``` | ||
|
||
Inside a virtualenv, run `pip install -r requirements.txt`. | ||
- Inside a virtualenv, run `pip install -r requirements.txt`. | ||
- See specific Mac OSX or Linux sections below for special Pillow and Matplotlib instructions. | ||
- Inside the virtualenv, run `python slackcloud.py`. The Flask application runs on **localhost:8081**. That port needs to be forwarded out to port 80 or 443 using Apache or Nginx on your webserver (the same one you set up to use for the Slash command). | ||
- In a slack channel, type `/command` and you should be greeted by a bot responding with a word cloud! | ||
|
||
### Mac OSX | ||
|
||
- `pip install Pillow` | ||
- Inside the virtualenv, `pip install Pillow` | ||
- If you try running the application in this state you will get an error message from Matplotlib complaining about running inside a virtualenv. See [Virtualenv FAQ](http://matplotlib.org/faq/virtualenv_faq.html) for how to workaround this. | ||
|
||
### Linux | ||
|
||
Installing **Pillow** on Linux can be a little bit tricky and depends on the distribution and OS packages. See [Pillow install instructions](http://pillow.readthedocs.org/en/3.0.x/installation.html#linux-installation) | ||
|
||
- Inside the virtualenv, run `python slackcloud.py`. You application by default runs on **localhost:8081**. That port needs to be publicly accessible or forward out to port 80 or 443 by your webserver. | ||
|
||
- In a slack channel, type `/command` and you should be greeted by a bot responding with a word cloud! |