Skip to content

Instantly share code, notes, and snippets.

@osapon
Created June 5, 2016 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osapon/4b09614eeced41c55c97d84114929253 to your computer and use it in GitHub Desktop.
Save osapon/4b09614eeced41c55c97d84114929253 to your computer and use it in GitHub Desktop.
put_slack() {
channel_id=`curl -s "https://slack.com/api/im.open" --data "token=${slack_team_key}" --data "user=${slack_user_id}" --data "pretty=1" | jq -r ".channel.id"`
curl -s 'https://slack.com/api/chat.postMessage' \
--data "token=${slack_team_key}" \
--data "channel=${channel_id}" \
--data "pretty=1" \
--data-urlencode "text=$1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment