Created
May 13, 2024 19:33
-
-
Save bpgould/58f23d2f2809fe8fe705c724776b46f1 to your computer and use it in GitHub Desktop.
Find unrequited Instagram followers using python
This file contains 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
import instaloader | |
L = instaloader.Instaloader() | |
L.login("username", "password") | |
# Obtain profile metadata | |
profile = instaloader.Profile.from_username(L.context, "username") | |
# people who follow you | |
fans = set() | |
for fan in profile.get_followers(): | |
fans.add(fan.username) | |
# people that you follow | |
i_follow = set() | |
for followee in profile.get_followees(): | |
i_follow.add(followee.username) | |
not_following_me_back = list(i_follow - fans) | |
with open("fake_friends.txt", "w") as f: | |
for faker in not_following_me_back: | |
f.write(f"{faker}\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment