Last active
August 29, 2015 14:02
-
-
Save loisaidasam/fc7da40b184828c10d8c to your computer and use it in GitHub Desktop.
A script for testing your Hubot's Slack webhook
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
#!/bin/bash | |
HEROKU_URL="$1" | |
if [ -z "$HEROKU_URL" ] ; then | |
HEROKU_URL=`heroku config:get HEROKU_URL` | |
fi | |
SLACK_URI="$HEROKU_URL/hubot/slack-webhook" | |
CODE=`curl -sL -w "%{http_code}" -o /dev/null -d "" "$SLACK_URI"` | |
echo "POST to $SLACK_URI code $CODE" >&2 | |
if [ "$CODE" -ne "200" ] ; then | |
echo "not cool" >&2 | |
exit 1 | |
fi | |
echo "cool" >&2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Test whether a Heroku-hosted Hubot with a Slack adapter has a correctly-behaving webhook.
A few notes: