Reference: https://gist.github.com/justlaputa/a6da84981eca963817e652b5f2452cfc
-
Generate authorization
token
for unstar. https://github.com/settings/tokens -
Export variable
export APIKEY=xxxxxxxxx
- Gain access to the starred repositories page.
curl -I -H "Authorization: token $APIKEY" https://api.github.com/user/starred
- Retrieve the list of starred repositories and save it to a file called
stars.txt
.
for p in `seq 1 4`;do
echo page
curl -s -H "Authorization: token $APIKEY" https://api.github.com/user/starred\?page\=$p | jq -r '.[] |.full_name' >>stars.txt
done
- Unstar any repositories that are listed in the
stars.txt
file.
while read REPO;do
echo
curl -X DELETE -s -H "Authorization: token $APIKEY" https://api.github.com/user/starred/$REPO
sleep .5
done<stars.txt