Skip to content

Instantly share code, notes, and snippets.

@almonteb
Created May 25, 2018 18:36
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 almonteb/f2fda243be7235c5e5a813dcfa63afa5 to your computer and use it in GitHub Desktop.
Save almonteb/f2fda243be7235c5e5a813dcfa63afa5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -euxo pipefail
function cleanup() {
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer ${SLACK_TOKEN}" \
-d '{"profile": {"status_emoji": "", "status_text": ""}}' \
-so /dev/null \
"https://slack.com/api/users.profile.set"
}
trap cleanup EXIT
curl -X POST -H "Content-Type: application/json" \
-H "Authorization: Bearer ${SLACK_TOKEN}" \
-d '{"profile": {"status_emoji": ":tomato:", "status_text": "Pomodoro → '$(echo $(date -d "+25 minutes" +%l:%M%P))'"}}' \
-so /dev/null \
"https://slack.com/api/users.profile.set"
curl -X GET -H "Authorization: Bearer ${SLACK_TOKEN}" \
-so /dev/null \
"https://slack.com/api/dnd.setSnooze?num_minutes=25"
sleep 1500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment