Skip to content

Instantly share code, notes, and snippets.

@lavir
Created October 13, 2017 10:34
Show Gist options
  • Save lavir/c13e67bb19998e328e38bdc85df7131f to your computer and use it in GitHub Desktop.
Save lavir/c13e67bb19998e328e38bdc85df7131f to your computer and use it in GitHub Desktop.
A command line utility for changing your Slack status.
#!/bin/bash
slacktoken=INSERT_SLACK_TOKEN_HERE
apiurl="https://slack.com/api/users.profile.set?token="$slacktoken"&profile="
lastname="LAST_NAME_HERE"
if [ $# -eq 0 ]
then
status=""
else
status=" | $@"
fi
curl --silent --data-urlencode "profile={\"last_name\":\"$lastname$status\"}" $apiurl > /dev/null
echo "Last name changed to $lastname$status"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment