Skip to content

Instantly share code, notes, and snippets.

@talesmantovani
Created August 3, 2017 19:24
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 talesmantovani/ff79a96489fbb7fba8aad356250cc375 to your computer and use it in GitHub Desktop.
Save talesmantovani/ff79a96489fbb7fba8aad356250cc375 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