This Python script automates the process of following GitHub users based on a list of usernames stored in text files. It uses the GitHub API and aiohttp
for asynchronous HTTP requests, allowing for efficient management of API rate limits and network resources.
- Load Environment Variables: The script loads your GitHub API token from a
.env
file. - Check Rate Limits: It checks the GitHub API rate limit before making requests to ensure compliance with GitHub's API usage policies.
- Follow Users: The script can follow GitHub users from a list of usernames specified in text files.
- Asynchronous Operations: Utilizing Python's
asyncio
andaiohttp
, the script can perform multiple follow operations concurrently, making it faster and more efficient.
-
Clone this repository to your local machine.
-
Ensure you have Python 3.7+ installed.
-
Install the required Python packages:
pip install aiohttp python-dotenv
-
Create a
.env
file in the root directory of the project and add your GitHub token:GITHUB_TOKEN=your_github_token_here
-
Prepare Usernames: Create a directory named
usernames
in the project root. Inside this directory, create text files where each file contains a list of GitHub usernames, one per line. -
Run the Script: Execute the script by running:
python your_script_name.py
-
Log Output: The script logs its progress, including rate limit checks, successful follows, and any errors encountered.
If you have a text file named usernames.txt
in the usernames
directory with the following content:
octocat
torvalds
mojombo
The script will attempt to follow these users on GitHub.
This script is particularly useful for individuals or organizations looking to build meaningful connections on GitHub. By following specific users, you can connect with influencers, potential collaborators, or contributors in your field.
Following users can boost your GitHub profile activity. It shows engagement within the community and can increase the likelihood of users following you back, thereby expanding your network.
Instead of manually following users one by one, this script automates the process, saving time and ensuring consistency in your outreach efforts.
- Make sure to handle your GitHub API token securely.
- Respect GitHub’s rate limits and API usage policies to avoid being rate-limited or banned.
- This script is intended for personal use; make sure to follow GitHub's terms of service regarding automated interactions.
This project is licensed under the MIT License. See the LICENSE file for details.