https://github.com/taxi-tabby/github-followerandtraitor
It's a tool with GitHub followers and follower management. Balance it out like Thanos.
https://github.com/taxi-tabby/github-followerandtraitor
github githubapi tool typescript
Last synced: about 1 month ago
JSON representation
It's a tool with GitHub followers and follower management. Balance it out like Thanos.
- Host: GitHub
- URL: https://github.com/taxi-tabby/github-followerandtraitor
- Owner: taxi-tabby
- Created: 2025-05-05T14:17:05.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-05T14:21:19.000Z (about 1 year ago)
- Last Synced: 2025-05-05T15:42:16.060Z (about 1 year ago)
- Topics: github, githubapi, tool, typescript
- Language: TypeScript
- Homepage: https://blog.smallbrain-labo.work/github-follow-tanos/
- Size: 36.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Follower Traitor
π΅οΈ Track who doesn't follow you back on GitHub
[English](#overview) | [νκ΅μ΄](#κ°μ)
---
## Overview
GitHub Follower Traitor is a command-line tool that helps you analyze and manage your GitHub followers and following relationships. It identifies users who don't follow you back ("traitors") and those you don't follow back, allowing you to easily manage your GitHub connections.
### Features
- π View statistics of your GitHub followers and following
- π Identify users who don't follow you back (traitors)
- π Find followers you don't follow back
- β
Bulk follow/unfollow options
- π― Individual user follow/unfollow capabilities
- π Detailed view of all followers and followings
## Installation
### Prerequisites
- Node.js (v16 or higher recommended)
- npm (comes with Node.js)
- GitHub Personal Access Token
### Setup
1. **Clone the repository**
```bash
git clone https://github.com/yourusername/github-follower-traitor.git
cd github-follower-traitor
```
2. **Install dependencies**
```bash
npm install
```
3. **Create .env file**
Create a `.env` file in the root directory with the following content:
```
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_USERNAME=your_github_username
# API Rate Limit Settings (milliseconds)
# GitHub allows 5,000 API requests per hour for authenticated users
# Wait time between each request (default: 1000ms = 1 second)
RATELIMIT_WAIT_MS=1000
# Timeout Settings (milliseconds)
# If the task is not completed within this time, progress is saved and the process exits
# The next execution will resume from the saved point
# Examples: 50 minutes = 3000000ms, 9 minutes = 540000ms
TIMEOVER_MS=3000000
```
> Note: To create a personal access token, go to GitHub Settings > Developer settings > Personal access tokens. Make sure to select the "user:follow" scope.
4. **Build the application**
```bash
npm run build
```
## Usage
### Running the Application
```bash
npm start
```
### Available Commands
Once you run the application, you'll see a menu with the following options:
1. **Follow all users who follow me but I don't follow back**
- Automatically follow all users who follow you but you don't follow back
2. **Unfollow all users who don't follow me back**
- Automatically unfollow all users who don't follow you (traitors)
3. **Follow a specific user**
- Follow a specific GitHub user by username
4. **Unfollow a specific user**
- Unfollow a specific GitHub user by username
5. **View detailed status**
- Access a sub-menu with detailed listing options:
- View all followers
- View all followings
- See all traitors (who don't follow you back)
- View all unfollowed followers (followers you don't follow)
0. **Exit**
- Close the application
## Development
```bash
# Run the application in development mode
npm run dev
# Watch mode (auto-compile on file changes)
npm run watch
# Lint the code
npm run lint
# Clean the build directory
npm run clean
# Rebuild (clean + build)
npm run rebuild
# π NEW: Instant Sync (Auto follow/unfollow)
npm run instant-run
```
### Menu Options
When you run the application, you'll see the following menu:
1. **Follow all users who follow me but I don't follow back** - Automatically follow all users who follow you but you don't follow back
2. **Unfollow all users who don't follow me back** - Automatically unfollow all users who don't follow you back
3. **Follow a specific user** - Follow a specific GitHub user
4. **Unfollow a specific user** - Unfollow a specific GitHub user
5. **View detailed status** - View detailed lists of followers, following, traitors, and unfollowed followers
6. **π Instant Sync (1 + 2)** - Automatically perform both options 1 and 2 in sequence for perfect synchronization
0. **Exit** - Exit the application
### Instant Sync Feature
The new **Instant Sync** feature (`npm run instant-run`) is perfect for quickly synchronizing your followers and following:
- Automatically unfollows users who don't follow you back
- Automatically follows users who follow you but you don't follow back
- Runs completely automatically without user interaction
- Displays detailed progress and final statistics
- Exits automatically when complete
- **Smart timeout handling**: If the process takes too long (based on `TIMEOVER_MS` setting), it saves progress to `savedata.json` and resumes from that point on the next run
- **Rate limit protection**: Respects GitHub API rate limits with configurable delays between requests (`RATELIMIT_WAIT_MS`)
This is ideal for:
- Daily maintenance of your GitHub following list
- Keeping follower/following counts balanced
- Automated scripts and scheduled tasks (cron jobs, etc.)
- Large follower/following lists that may exceed time limits
**How it works with cron jobs:**
If you schedule this script to run every hour or every 10 minutes, and it doesn't complete within the `TIMEOVER_MS` limit:
1. The script saves its progress to `savedata.json`
2. On the next scheduled run, it automatically resumes from where it left off
3. When all tasks are completed, `savedata.json` is automatically deleted
## License
This project is get no license.
---
# GitHub Follower Traitor
π΅οΈ GitHubμμ λ§νλ‘μ°νμ§ μλ μ¬μ©μ μΆμ νκΈ°
## κ°μ
GitHub Follower Traitorλ GitHub νλ‘μμ νλ‘μ κ΄κ³λ₯Ό λΆμνκ³ κ΄λ¦¬νλ 컀맨λλΌμΈ λꡬμ
λλ€. λ§νλ‘μ°νμ§ μλ μ¬μ©μ("λ°°μ μ")μ λΉμ μ΄ νλ‘μ°νμ§ μλ νλ‘μλ₯Ό μλ³νμ¬ GitHub μ°κ²°μ μ½κ² κ΄λ¦¬ν μ μκ² λμμ€λλ€.
### κΈ°λ₯
- π GitHub νλ‘μ λ° νλ‘μ ν΅κ³ νμΈ
- π λ§νλ‘μ°νμ§ μλ μ¬μ©μ(λ°°μ μ) μλ³
- π λΉμ μ΄ νλ‘μ°νμ§ μλ νλ‘μ μ°ΎκΈ°
- β
μΌκ΄ νλ‘μ°/μΈνλ‘μ° μ΅μ
- π― κ°λ³ μ¬μ©μ νλ‘μ°/μΈνλ‘μ° κΈ°λ₯
- π λͺ¨λ νλ‘μ λ° νλ‘μ μμΈ λ³΄κΈ°
## μ€μΉ
### νμ 쑰건
- Node.js (v16 μ΄μ κΆμ₯)
- npm (Node.jsμ ν¨κ» μ 곡)
- GitHub κ°μΈ μ‘μΈμ€ ν ν°
### μ€μ
1. **μ μ₯μ 볡μ **
```bash
git clone https://github.com/yourusername/github-follower-traitor.git
cd github-follower-traitor
```
2. **μμ‘΄μ± μ€μΉ**
```bash
npm install
```
3. **.env νμΌ μμ±**
λ£¨νΈ λλ ν 리μ λ€μ λ΄μ©μΌλ‘ `.env` νμΌμ μμ±νμΈμ:
```
GITHUB_TOKEN=your_github_personal_access_token
GITHUB_USERNAME=your_github_username
# API Rate Limit μ€μ (λ°λ¦¬μ΄)
# GitHubλ μΈμ¦λ μ¬μ©μμκ² μκ°λΉ 5,000건μ API μμ²μ νμ©
# κ° μμ² μ¬μ΄μ λκΈ° μκ° (κΈ°λ³Έκ°: 1000ms = 1μ΄)
RATELIMIT_WAIT_MS=1000
# Timeout μ€μ (λ°λ¦¬μ΄)
# μ΄ μκ° λ΄μ μμ
μ΄ μλ£λμ§ μμΌλ©΄ μ§ν μνλ₯Ό μ μ₯νκ³ μ’
λ£
# λ€μ μ€ν μ μ μ₯λ μ§μ λΆν° μ¬κ°λ¨
# μ: 50λΆ = 3000000ms, 9λΆ = 540000ms
TIMEOVER_MS=3000000
```
> μ°Έκ³ : κ°μΈ μ‘μΈμ€ ν ν°μ μμ±νλ €λ©΄ GitHub μ€μ > κ°λ°μ μ€μ > κ°μΈ μ‘μΈμ€ ν ν°μΌλ‘ μ΄λνμΈμ. "user:follow" λ²μλ₯Ό μ νν΄μΌ ν©λλ€.
4. **μ ν리μΌμ΄μ
λΉλ**
```bash
npm run build
```
## μ¬μ©λ²
### μ ν리μΌμ΄μ
μ€ν
```bash
npm start
```
### μ¬μ© κ°λ₯ν λͺ
λ Ή
μ ν리μΌμ΄μ
μ μ€ννλ©΄ λ€μ μ΅μ
μ΄ ν¬ν¨λ λ©λ΄κ° νμλ©λλ€:
1. **λλ₯Ό νλ‘μ°νλλ° λ΄κ° νλ‘μ°νμ§ μλ λͺ¨λ μ¬λμ νλ‘μ°νκΈ°**
- λΉμ μ νλ‘μ°νμ§λ§ λΉμ μ΄ νλ‘μ°νμ§ μλ λͺ¨λ μ¬μ©μλ₯Ό μλμΌλ‘ νλ‘μ°ν©λλ€
2. **λλ₯Ό νλ‘μ°νμ§ μλλ° λ΄κ° νλ‘μ°νκ³ μλ λͺ¨λ μ¬λ μΈνλ‘μ°νκΈ°**
- λΉμ μ νλ‘μ°νμ§ μλ λͺ¨λ μ¬μ©μ(λ°°μ μ)λ₯Ό μλμΌλ‘ μΈνλ‘μ°ν©λλ€
3. **νΉμ μ¬μ©μ νλ‘μ°νκΈ°**
- μ¬μ©μ μ΄λ¦μΌλ‘ νΉμ GitHub μ¬μ©μλ₯Ό νλ‘μ°ν©λλ€
4. **νΉμ μ¬μ©μ μΈνλ‘μ°νκΈ°**
- μ¬μ©μ μ΄λ¦μΌλ‘ νΉμ GitHub μ¬μ©μλ₯Ό μΈνλ‘μ°ν©λλ€
5. **μΈλΆ μν보기**
- μμΈ λͺ©λ‘ μ΅μ
μ΄ μλ νμ λ©λ΄μ μ κ·Όν©λλ€:
- λͺ¨λ νλ‘μ λͺ©λ‘ 보기
- λͺ¨λ νλ‘μ λͺ©λ‘ 보기
- λͺ¨λ λ°°μ μ λͺ©λ‘ 보기 (λλ₯Ό νλ‘μ°νμ§ μλ μ¬λ)
- λͺ¨λ λ―Ένλ‘μ° νλ‘μ λͺ©λ‘ 보기 (λ΄κ° νλ‘μ°νμ§ μλ νλ‘μ)
6. **π μ¦μ λκΈ°ν (1 + 2)**
- 1λ²κ³Ό 2λ² μ΅μ
μ μμ°¨μ μΌλ‘ μλ μ€ννμ¬ μλ²½ν λκΈ°νλ₯Ό μνν©λλ€
0. **μ’
λ£νκΈ°**
- μ ν리μΌμ΄μ
μ μ’
λ£ν©λλ€
### μ¦μ λκΈ°ν κΈ°λ₯
μλ‘μ΄ **μ¦μ λκΈ°ν** κΈ°λ₯ (`npm run instant-run`)μ νλ‘μμ νλ‘μμ λΉ λ₯΄κ² λκΈ°ννλ λ° μλ²½ν©λλ€:
- λλ₯Ό νλ‘μ°νμ§ μλ μ¬μ©μλ€μ μλμΌλ‘ μΈνλ‘μ°
- λλ₯Ό νλ‘μ°νμ§λ§ λ΄κ° νλ‘μ°νμ§ μλ μ¬μ©μλ€μ μλμΌλ‘ νλ‘μ°
- μ¬μ©μ μνΈμμ© μμ΄ μμ ν μλμΌλ‘ μ€ν
- μμΈν μ§ν μν©κ³Ό μ΅μ’
ν΅κ³ νμ
- μλ£ μ μλμΌλ‘ μ’
λ£
- **μ€λ§νΈ νμμμ μ²λ¦¬**: μμ
μ΄ λ무 μ€λ 걸리λ κ²½μ°(`TIMEOVER_MS` μ€μ κΈ°μ€), `savedata.json`μ μ§ν μν©μ μ μ₯νκ³ λ€μ μ€ν μ ν΄λΉ μ§μ λΆν° μ¬κ° (instant-run νμ )
- **Rate Limit 보νΈ**: μμ² μ¬μ΄μ μ§μ° μκ°μ μ€μ (`RATELIMIT_WAIT_MS`)νμ¬ GitHub API ratelimit μ μκ±Έλ¦¬κ² νκΈ° μν μ΅μνμ μ‘°μΉ (instant-run νμ )
λ€μκ³Ό κ°μ κ²½μ°μ μ΄μμ μ
λλ€:
- GitHub νλ‘μ λͺ©λ‘μ μΌμΌ κ΄λ¦¬
- νλ‘μ/νλ‘μ μμ κ· ν μ μ§
- μλνλ μ€ν¬λ¦½νΈ λ° μμ½λ μμ
(cron μμ
λ±)
- μκ° μ νμ μ΄κ³Όν μ μλ λκ·λͺ¨ νλ‘μ/νλ‘μ λͺ©λ‘
**Cron μμ
κ³Ό ν¨κ» μλνλ λ°©λ²:** (instant-run νμ )
1μκ°λ§λ€ λλ 10λΆλ§λ€ μ΄ μ€ν¬λ¦½νΈλ₯Ό μ€ννλλ‘ μμ½νλλ° `TIMEOVER_MS` μ ν λ΄μ μλ£λμ§ μλ κ²½μ°:
1. μ€ν¬λ¦½νΈκ° μ§ν μν©μ `savedata.json`μ μ μ₯
2. λ€μ μμ½λ μ€ν μ μλμΌλ‘ μ€λ¨λ μ§μ λΆν° μ¬κ°
3. λͺ¨λ μμ
μ΄ μλ£λλ©΄ `savedata.json`μ΄ μλμΌλ‘ μμ λ¨
## κ°λ°
```bash
# κ°λ° λͺ¨λλ‘ μ ν리μΌμ΄μ
μ€ν
npm run dev
# κ°μ λͺ¨λ (νμΌ λ³κ²½ μ μλ μ»΄νμΌ)
npm run watch
# μ½λ λ¦°νΈ
npm run lint
# λΉλ λλ ν 리 μ 리
npm run clean
# μ¬λΉλ (clean + build)
npm run rebuild
# π μλ‘μ΄ κΈ°λ₯: μ¦μ λκΈ°ν (μλ νλ‘μ°/μΈνλ‘μ°)
npm run instant-run
```
## λΌμ΄μΌμ€
μ΄ νλ‘μ νΈλ λΌμ΄μ μ€κ° μμ΅λλ€.
----
> λ©μΈ νλ©΄
```bash
(base) PS R:\project\github-follower-traitor> npm run start
> github-follower-traitor@1.0.0 start
> node dist/index.js
GitHub Follower and Traitor μ ν리μΌμ΄μ
μ΄ μμλμμ΅λλ€!
νμ¬ μκ°: 2025. 5. 5. μ€ν 11:19:10
"taxi-tabby" μ¬μ©μμ νλ‘μμ νλ‘μ μ 보λ₯Ό κ°μ Έμ€λ μ€...
followers (νλ‘μ μ): 27
following (νλ‘μ μ): 27
λ΄κ° νλ‘μ°νμ§λ§ λλ₯Ό νλ‘μ°νμ§ μλ μ¬μ©μ μ: 0
λ°°μ μ λͺ©λ‘:
λλ₯Ό νλ‘μ°νμ§λ§ λ΄κ° νλ‘μ°νμ§ μλ μ¬μ©μ μ: 0
νλ‘μ°νμ§ μλ νλ‘μ:
π GitHub Follow control menu:
1: Follow all users who follow me but I don't follow back - λλ₯Ό νλ‘μ°νλλ° λ΄κ° νλ‘μ°νμ§ μλ λͺ¨λ μ¬λμ νλ‘μ°νκΈ°
2: Unfollow all users who don't follow me back - λλ₯Ό νλ‘μ°νμ§ μλλ° λ΄κ° νλ‘μ°νκ³ μλ λͺ¨λ μ¬λ μΈνλ‘μ°νκΈ°
3: Follow a specific user - νΉμ μ¬μ©μ νλ‘μ°νκΈ°
4: Unfollow a specific user - νΉμ μ¬μ©μ μΈνλ‘μ°νκΈ°
5: View detailed status - μΈλΆ μν보기 (Sub Menu)
0: Exit - μ’
λ£νκΈ°
```