Last active
July 1, 2020 12:14
-
-
Save victorgs/ccc9911c51b3bca3ff07eddbb3f1ef52 to your computer and use it in GitHub Desktop.
Unfollow everyone who you currently follow on GitHub
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
# it does not manage pagination | |
# just run it until you do not see more unfollowing messages | |
# token needs user:follow permissions | |
TOKEN=$1 | |
USER_LIST=$(curl -sS -H "Authorization: token $TOKEN" https://api.github.com/user/following | grep login | awk NF | awk -F'"' '{print $4}') | |
for user in $USER_LIST; do | |
echo "unfollowing $user\n" | |
curl -sS -X DELETE -H "Authorization: token $TOKEN" https://api.github.com/user/following/$user | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment