Created
May 25, 2018 18:36
-
-
Save almonteb/f2fda243be7235c5e5a813dcfa63afa5 to your computer and use it in GitHub Desktop.
This file contains 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
#!/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