a python script that sends messages to a slack webhook when the output from a script changes
python python sh (https://pypi.python.org/pypi/sh)
The script looks for files ending with .json inside a scripts dir. It executes them and records their stdout. If the output has changed it pushes to a configured slack webhook.
- run
slack_differ.py example
chmod +x
the example.sh it produces under the new scripts dir- change the configuration in
scripts/example.json
to match your webhook url
{
"script":"example.sh",
"title":"script title",
"user":"examplebot",
"slack_url":"https://hook.slack.com/XXX/YYY",
"channel":"#example",
"emoji":":metal:"
}