GhostBuster is my personal GitHub following cleaner! This sleek Go application intelligently identifies and unfollows users who aren't following me back. Keep my GitHub network tidy and reciprocal with ease ✨.
Getting GhostBuster up and running on your local machine is straightforward. Follow these steps:
Before you begin, ensure you have Go (version 1.23.5 or newer, as specified in go.mod) installed on your system.
First, clone the project repository to your local machine:
git clone https://github.com/samueltuoyo15/Github-Unfollow.git
cd Github-UnfollowThis application requires a GitHub Personal Access Token to interact with the GitHub API.
✨ Create a new file named .env in the root directory of the project:
touch .env📝 Open the .env file and add your GitHub Personal Access Token:
MY_GITHUB_TOKEN=YOUR_GITHUB_PERSONAL_ACCESS_TOKEN- Important: Replace
YOUR_GITHUB_PERSONAL_ACCESS_TOKENwith your actual token. Ensure this token hasuser:followscope to allow unfollowing. For security, never commit your.envfile to version control!
Navigate to the project root and fetch the necessary Go modules:
go mod tidyOnce dependencies are installed, you can run the application from the cmd directory:
go run cmd/main.goOnce installed, running GhostBuster is simple. The application will automatically connect to the GitHub API using your provided token, identify non-followers, and proceed to unfollow them.
-
Execute the application: Open your terminal, navigate to the
Github-Unfollowdirectory, and run:go run cmd/main.go
-
Observe the output: The application will first display your GitHub username, then proceed to fetch your followers and the users you are following.
If there are no users to unfollow (everyone you follow also follows you back), you will see a message like:
No one to unfollow. am all good!If there are users who are not following you back, the application will list them and then begin the unfollowing process:
These are the people that aren't following me back: - user1 Successfully Unfollowed user1 - user2 Successfully Unfollowed user2 Failed to unfollow user3: API error message here ... Successfully unfollowed X users.- Note on rate limiting: The application includes a small delay (
500ms) between unfollow actions to respect GitHub API rate limits. This helps prevent potential issues with too many rapid requests.
- Note on rate limiting: The application includes a small delay (
GhostBuster is designed to be effective and user-friendly, offering the following capabilities:
- Automated Unfollowing: Automatically scans your GitHub following list and unfollows accounts that do not follow you back, saving you manual effort.
- GitHub API Integration: Built upon
github.com/google/go-github, ensuring reliable and up-to-date interaction with the GitHub API. - Secure Credential Management: Utilizes
godotenvto securely load your GitHub Personal Access Token from an environment file, keeping sensitive information out of your codebase. - Rate Limit Compliance: Implements strategic delays between API calls to gracefully handle GitHub's rate limits, preventing service interruptions.
- Informative Output: Provides clear, real-time feedback on which accounts are being unfollowed, along with a final summary of the operation.
This project is crafted with modern Go practices and relies on a few well-regarded libraries:
| Technology | Description | Link |
|---|---|---|
| Go | The primary programming language used. | go.dev |
| Go-GitHub | Official Go client for the GitHub API. | GitHub |
| OAuth2 | Go packages for OAuth 2.0. | GitHub |
| Godotenv | Loads environment variables from a .env file. |
GitHub |
No specific license file was found within this repository. If you plan to use or distribute this project, please consider adding an explicit license.
Hi there! I'm Samuel Tuoyo, the creator of GhostBuster. I'm passionate about building practical tools with Go that simplify everyday development tasks.
Feel free to connect with me:
- GitHub: @samueltuoyo15
- LinkedIn: Your LinkedIn Profile
- Twitter: @your_twitter