-
Clone the repository
-
Create a GitHub oAuth Token that has the
user:follow
scope. That token is only available once so make sure to save it! -
Create an
.env
file in the root of the repository that contains the following:
MY_TOKEN={{OAUTH_TOKEN_VALUE}}
That value is automatically read using os
and dotenv
- Run the file:
python3 github_script.py
The GitHub Developers documentation explains how to follow and unfollow people. I wanted to automate this process using python and the requests library. This project is just for fun, the number of followers I have doesn't matter to me 😆
For some reason, I've noticed that the displayed number of followers/following in the user overview doesn't change, even if you manually unfollow someone. To double-check, look at the outputted list of users after you run the script and see if you still follow them/they still follow you.