Skip to content

Instantly share code, notes, and snippets.

@bpgould
Created May 13, 2024 19:33
Show Gist options
  • Save bpgould/58f23d2f2809fe8fe705c724776b46f1 to your computer and use it in GitHub Desktop.
Save bpgould/58f23d2f2809fe8fe705c724776b46f1 to your computer and use it in GitHub Desktop.
Find unrequited Instagram followers using python
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