An open API service indexing awesome lists of open source software.

https://github.com/jlw-7/github-nonfollowers-checker

A fun tool to check who's not following you back on github (and perhaps unfollow them 😏)
https://github.com/jlw-7/github-nonfollowers-checker

developer-console github-api javascript

Last synced: about 1 year ago
JSON representation

A fun tool to check who's not following you back on github (and perhaps unfollow them 😏)

Awesome Lists containing this project

README

          

# πŸ“Ÿ GitHub Non-Followers Checker

A simple, client-side tool that helps you identify which GitHub users you follow that don't follow you back. (I know, sometimes you would want to unfollow those who don't follow you back 😏)

---

### πŸš€ How to Use

1. Open your browser's **Developer Console**:

* Windows: `Ctrl + Shift + J`
* Mac: `Cmd + Option + I`

2. Paste the full JavaScript code below and hit **Enter**. (Or you can click [here](checker.js) for the code):
``` javascript
"use strict";

const GITHUB_API_URL = "https://api.github.com/users/";

let nonFollowersList = [];
let isActiveProcess = false;

function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}

async function getAllFollowers(username) {
let followers = [];
let page = 1;
while (true) {
const response = await fetch(`${GITHUB_API_URL}${username}/followers?per_page=100&page=${page}`);
if (!response.ok) throw new Error('Error fetching followers: ' + response.statusText);
const data = await response.json();
if (data.length === 0) break;
followers = followers.concat(data);
page++;
}
return followers;
}

async function getAllFollowing(username) {
let following = [];
let page = 1;
while (true) {
const response = await fetch(`${GITHUB_API_URL}${username}/following?per_page=100&page=${page}`);
if (!response.ok) throw new Error('Error fetching following: ' + response.statusText);
const data = await response.json();
if (data.length === 0) break;
following = following.concat(data);
page++;
}
return following;
}

async function findNonFollowers(username) {
if (isActiveProcess) return;
isActiveProcess = true;
showLoading(true);
showError("");

try {
const followers = await getAllFollowers(username);
const following = await getAllFollowing(username);

const followerSet = new Set(followers.map(user => user.login));
nonFollowersList = following.filter(user => !followerSet.has(user.login));
renderResults(nonFollowersList);
} catch (error) {
console.error(error);
showError(error.message);
} finally {
isActiveProcess = false;
showLoading(false);
}
}

function renderResults(users) {
const container = document.querySelector(".results-container");
container.innerHTML = "";

if (users.length === 0) {
container.innerHTML = `

πŸŽ‰ Everyone follows you back!
`;
} else {
users.forEach(user => {
const el = document.createElement("div");
el.className = "user";
el.innerHTML = `@${user.login}`;
container.appendChild(el);
});
}

document.querySelector(".nonfollower-count").textContent = `Non-followers: ${users.length}`;
}

function showLoading(show) {
document.querySelector(".loader").style.display = show ? "block" : "none";
}

function showError(msg) {
document.querySelector(".error-message").textContent = msg;
}

function renderOverlay(username) {
document.body.innerHTML = `

GitHub Non-Followers Checker



πŸ” Check Non-Followers

Loading...




Non-followers: 0


`;

document.getElementById("check-followers-btn").addEventListener("click", () => {
findNonFollowers(username);
});
}

function init() {
const username = prompt("Enter your GitHub username:");
if (username) {
renderOverlay(username);
} else {
alert("Username is required!");
}
}

init();
```
3. When prompted, enter your **GitHub username**.
4. Click **Check Non-Followers** in the interface that appears.
5. View the list of users who don’t follow you back.
6. Clicking on a user's name brings you directly to their profile. Then, you can unfollow them! (I mean if you want to)

___

### πŸ” Features

* βœ… Fetches **all followers** and **following** with GitHub API pagination.
* πŸ“ƒ Lists users you follow but who **don’t follow you back**.
* πŸ”— Clickable GitHub profile links for each non-follower.
* ⚑ Minimalistic, fast UI with no dependencies.
* πŸ” Runs **entirely in the browser** β€” no login, token, or backend needed.

---

### πŸ“Έ Preview

App UI Preview

---

### ⚠️ Disclaimer

> This project is not affiliated with, endorsed by, or connected to GitHub in any way. Use at your own discretion. It uses GitHub's public REST API without authentication, which is rate-limited (\~60 requests/hour).

---

### 🀝 Contributions

Feel free to open issues or pull requests to improve the tool.

---

### πŸ“„ License

GNU 3.0 License. See `LICENSE` file.