-
-
Save CatalinPlesu/02ed654c8e5354068eb48dff09e37e2c to your computer and use it in GitHub Desktop.
instagram_follow_unfollow.js
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
| // Simple extraction function | |
| function get_list() { | |
| const elements = document.querySelectorAll('._aad7'); | |
| return Array.from(elements).map(el => el.innerText.trim()); | |
| } | |
| // Your two lists | |
| let list1 = []; | |
| let list2 = []; | |
| // Extract to list1 (after you finish scrolling manually) | |
| function extract_list1() { | |
| list1 = get_list(); | |
| console.log(`β List1 saved: ${list1.length} items`); | |
| } | |
| // Extract to list2 (after you finish scrolling manually) | |
| function extract_list2() { | |
| list2 = get_list(); | |
| console.log(`β List2 saved: ${list2.length} items`); | |
| } | |
| // Simple diff function | |
| function get_diff() { | |
| const in1not2 = list1.filter(item => !list2.includes(item)); | |
| const in2not1 = list2.filter(item => !list1.includes(item)); | |
| console.log(`\nπ LIST COMPARISON:`); | |
| console.log(`List1: ${list1.length} items`); | |
| console.log(`List2: ${list2.length} items`); | |
| console.log(`\nπ In List1 but NOT in List2:`); | |
| in1not2.forEach(item => console.log(` - ${item}`)); | |
| console.log(`\nπ In List2 but NOT in List1:`); | |
| in2not1.forEach(item => console.log(` - ${item}`)); | |
| return { in1not2, in2not1 }; | |
| } | |
| // Usage instructions | |
| console.log(` | |
| π― SIMPLE WORKFLOW: | |
| 1. Navigate to first list (followers/following) | |
| 2. Scroll manually until you see all items | |
| 3. Run: extract_list1() | |
| 4. Navigate to second list | |
| 5. Scroll manually until you see all items | |
| 6. Run: extract_list2() | |
| 7. Run: get_diff() | |
| `); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it was tested only with 59 items in a list