https://github.com/norm/slack-tools
Tools. You know, for Slack.
https://github.com/norm/slack-tools
Last synced: 2 months ago
JSON representation
Tools. You know, for Slack.
- Host: GitHub
- URL: https://github.com/norm/slack-tools
- Owner: norm
- Created: 2015-07-24T09:49:07.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-11-29T09:09:24.000Z (over 10 years ago)
- Last Synced: 2025-01-19T10:32:38.115Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
Miscellaneous Slack Tools
=========================
All written in python. You will need to have the `requests` library installed
(`sudo pip install requests`).
## add-github-webhook
If you don't like Slack having write access to Github in order to provide
notifications, use this script to easily add a webhook to your repo.
Usage:
# set the env variables
export GITHUB_TOKEN=somethingsomethingtoken
export SLACK_WEBHOOK=https://hooks.slack.com/...
# add one (or more) repos...
python add-github-webhook norm/slack-tools norm/bash-composition
# ...or add all repos owned by the GITHUB_TOKEN's owner
python add-github-webhook -u
And if you change your mind:
# delete all webhooks on one (or more) repos...
python add-github-webhook -d norm/slack-tools norm/bash-composition
# ...or all repos owned by the GITHUB_TOKEN's owner
python add-github-webhook -ud
## pubsub-to-slack
Push notifications to Slack by using redis pubsub. For when you don't
want your app to push information into Slack directly.
Listens to the namespace `chatter*`.
Pre-requisites:
* Have redis running.
* Install python libraries:
pip install redis requests
Run the script:
export SLACK_WEBHOOK=https://hooks.slack.com/...
python pubsub-to-slack
Then publish messages to redis:
# send plain text
redis-cli publish chatter 'hello world'
# send a JSON payload
redis-cli publish chatter '{"text":"Hello", "username":"via-redis"}'
...and they should appear in Slack!