Skip to content

joecarl/linf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

linf

List instagram non followers

So some f****** as***** decided to unfollow you but they didn't remove you form their followers.

Let's find them and unfollow them too!

Login into your IG account on your PC, go to your profile and press F12 to open a console.

Paste this code and hit enter:

const regex = /^\/api\/v1\/friendships\/([^/]+)\/followers\//;
const OriginalXHR = window.XMLHttpRequest;

window.XMLHttpRequest = function() {
	const xhr = new OriginalXHR();

	const open = xhr.open;
	xhr.open = function(method, url, ...rest) {	
		const match = url.match(regex);
		if (match) {
			const userId = match[1];
			console.log('User ID:', userId);
			console.log('Fetching data ...');
			linf(userId);
		}
		return open.apply(xhr, [method, url, ...rest]);
	};

	return xhr;
};

async function linf(userId) {

	async function fetchAllUsers(listType) {
		let maxId = null;
		let resultados = [];
		let urlBase = '/api/v1/friendships/' + userId + '/' + listType + '/';

		do {
			const url = maxId ? `${urlBase}?max_id=${maxId}` : urlBase;

			const response = await fetch(url, {
				method: 'GET',
				headers: {
					'x-ig-app-id': '936619743392459',
				}
			});
			if (!response.ok) {
			throw new Error(`Error en la petición: ${response.status}`);
			}

			const data = await response.json();
			resultados.push(...data.users);
			maxId = data.next_max_id;
		
		} while(maxId);

		return resultados;
	}

	const followers = await fetchAllUsers('followers');
	const following = await fetchAllUsers('following');

	console.clear();
	console.log(followers.length + ' followers');
	console.log(following.length + ' following');

	const followersIds = new Set(followers.map(user => user.id));
	const cabrones = following.filter(user => !followersIds.has(user.id));

	for(let cabron of cabrones) {
		console.log(cabron.full_name + ' (@' + cabron.username + ')');
	}
}

console.clear();

document.querySelectorAll('a[href]').forEach(n => {
	if (n.getAttribute('href').contains('/followers/')){
		n.click();
	}
});

Wait for some seconds et voila! All those who unfollowed you will be listed in the console!

About

List instagram non followers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published