An open API service indexing awesome lists of open source software.

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.

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!