Skip to content

Instantly share code, notes, and snippets.

@shimesaba-type0
Created May 23, 2021 08:40
Show Gist options
  • Save shimesaba-type0/45994d0e49aef1b959ead3a1eb6eb2a0 to your computer and use it in GitHub Desktop.
Save shimesaba-type0/45994d0e49aef1b959ead3a1eb6eb2a0 to your computer and use it in GitHub Desktop.
memo
#!/bin/bash
set -eu
cd $(dirname $0)
# slack webhook url
URL="https://hooks.slack.com/services/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"
# CURL="/usr/bin/curl"
# method -X
METHOD="POST"
# header -H
HEADER="'Content-type: application/json'"
TYPE="application/json"
# payload
# PAYLOAD="{\"text\":\"hello, world\"}"
PAYLOAD=$(cat << EOS
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "This is a mrkdwn section block :ghost: ${METHOD} "
}
}
EOS
)
echo \"$PAYLOAD\"
exit
# exit
/usr/bin/curl -sSv \
-X ${METHOD} \
-H "'Content-type: "${TYPE}"'" \
--data \"${PAYLOAD}\" \
${URL}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment