Created
January 9, 2015 05:28
-
-
Save nuex/638963c1410109c47c47 to your computer and use it in GitHub Desktop.
Say something in a Slack channel without being there.
This file contains hidden or 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/sh | |
# | |
# Say something in a slack channel. | |
# | |
# Usage: | |
# | |
# standup 't: doing a thing' | |
# | |
# Finding Values: | |
# | |
# Use the API docs to find values that you need: | |
# | |
# * Token: https://api.slack.com/web | |
# * Channel ids: https://api.slack.com/methods/channels.list/test | |
# | |
# Other needed variables: | |
# | |
# `icon_url` is a URL for an icon image, such as a Gravatar. | |
# `username` the username of the user posting the message | |
# | |
curl -X POST https://slack.com/api/chat.postMessage \ | |
--data-urlencode "text=$@" \ | |
-d token=$SLACK_TOKEN \ | |
-d channel=$SLACK_CHANNEL_ID \ | |
-d username=$SLACK_USERNAME \ | |
-d icon_url=$SLACK_ICON_URL \ | |
-d pretty=1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment