Last active
January 20, 2025 09:35
-
-
Save iamshubhamjangle/3aaf799341f242886be765313dee9214 to your computer and use it in GitHub Desktop.
Instagram Followers and Non followers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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