Skip to content

Instantly share code, notes, and snippets.

@nullfieldio
Created March 5, 2015 19:10
Show Gist options
  • Save nullfieldio/e5e7a1ba7fa20b89fd1c to your computer and use it in GitHub Desktop.
Save nullfieldio/e5e7a1ba7fa20b89fd1c to your computer and use it in GitHub Desktop.
slack bash webhook
#!/bin/bash -e
URL= #https://hooks.slack.com/services/<YOUR ID> from webhooks on https://myteam.slack.com/services
CHANNEL="#general" # name of channel
MESSAGE="Hello World" # message
NICK="troll" # bot name
# post message
curl -X POST \
--data "payload={\"channel\": \"${CHANNEL}\", \"username\": \"${NICK}\", \"text\": \"${MESSAGE}\", \"icon_emoji\": \":troll:\"}" ${URL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment