Skip to content

Instantly share code, notes, and snippets.

@ifnull
Created March 21, 2018 19:58
Show Gist options
  • Save ifnull/e4e45285c9020f95917e1110c412c135 to your computer and use it in GitHub Desktop.
Save ifnull/e4e45285c9020f95917e1110c412c135 to your computer and use it in GitHub Desktop.
Test to pull tokens from keychain and delete all conversations
brew install jq
pip install slack-cleaner
SLACK_TOKENS=$(security find-generic-password -w -s "Slack")
for row in $(echo "${SLACK_TOKENS}" | jq -r '[.[].token]'); do
TOKEN=$(echo ${row} | sed 's/"//g')
echo $TOKEN
slack-cleaner --token ${TOKEN} --message --channel foobar --user foobar
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment