Skip to content

Instantly share code, notes, and snippets.

@iamshubhamjangle
Last active January 20, 2025 09:35
Show Gist options
  • Select an option

  • Save iamshubhamjangle/3aaf799341f242886be765313dee9214 to your computer and use it in GitHub Desktop.

Select an option

Save iamshubhamjangle/3aaf799341f242886be765313dee9214 to your computer and use it in GitHub Desktop.
Instagram Followers and Non followers
const arr = document.getElementById('followers')
const followers = [];
arr.querySelectorAll('a[href^="/"]').forEach(a => {
followers.push(a.href)
});
const following = [];
const arr2 = document.getElementById('following')
arr2.querySelectorAll('a[href^="/"]').forEach(a => {
following.push(a.href)
});
// Find users who don't follow back
const notFollowBack = following.filter(user => !followers.includes(user));
// Find users who I don't follow back
const notFollowingBack = followers.filter(user => !following.includes(user));
console.log("Users who don't follow back:", notFollowBack);
console.log("Users who I don't follow back:", notFollowingBack);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment