ifnull
3/21/2018 - 7:58 PM

Test to pull tokens from keychain and delete all conversations

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