-
Notifications
You must be signed in to change notification settings - Fork 0
/
followScrap.py
61 lines (48 loc) · 1.51 KB
/
followScrap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from getpass import getpass
import instaloader
ig = instaloader.Instaloader()
user = input("Username: ")
password = getpass()
ig.login(user, password)
print(f"\033[0;32mSuccefully logged in @{user}!\033[m")
profile = instaloader.Profile.from_username(ig.context, user)
following_list = []
followers_list = []
notfollowme_list = []
inotfollow_list = []
def get_following():
print("Getting following list...")
for followee in profile.get_followees():
following_list.append(followee.username)
def get_followers():
print("Getting followers list...")
for follower in profile.get_followers():
followers_list.append(follower.username)
get_following()
get_followers()
print("=====================================================")
print("\033[0;31mWho doesn't follow me back\033[m")
def not_follow_me():
open("notfollowme.txt", "w").close()
nfm = open("notfollowme.txt", "a")
for i in following_list:
if i not in followers_list:
notfollowme_list.append(i)
nfm.write(i + "\n")
else:
pass
not_follow_me()
print(notfollowme_list)
print("=====================================================")
print("\033[0;34mWho I don't follow back\033[m")
def i_not_follow():
open("inotfollow.txt", "w").close()
inf = open("inotfollow.txt", "a")
for i in followers_list:
if i not in following_list:
inotfollow_list.append(i)
inf.write(i + "\n")
else:
pass
i_not_follow()
print(inotfollow_list)