-
Notifications
You must be signed in to change notification settings - Fork 0
/
unfollowers_old.py
59 lines (43 loc) · 1.56 KB
/
unfollowers_old.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
import json
# get information from followers file
with open('followers.json') as f:
follower = json.load(f)
# get information from following file
with open('following.json') as g:
following = json.load(g)
followers_list = []
following_list = []
following_list_url = []
for i in follower['relationships_followers']:
followers_list.append(i['string_list_data'][0]['value'])
for i in following['relationships_following']:
following_list.append(i['string_list_data'][0]['value'])
following_list_url.append(i['string_list_data'][0]['href'])
followers_list.sort()
following_list.sort()
following_list_url.sort()
print("Seguidores: " + str(len(followers_list)))
print("Siguiendo: " + str(len(following_list)))
dont_follow_back = []
dont_follow_back_url = []
print("\nUsuarios que no te siguen de vuelta: ")
for _ in range(len(following_list)):
if following_list[_] not in followers_list:
dont_follow_back.append(following_list[_])
dont_follow_back_url.append(following_list_url[_])
for _ in range(len(dont_follow_back)):
print(dont_follow_back[_], " | ", dont_follow_back_url[_])
try:
os.remove("list.txt")
except:
"No existe list.txt, se creará"
with open("list.txt", 'x') as l:
l.write("USUARIOS QUE NO TE SIGUEN DE VUELTA:\n")
i = 0
for _ in range(len(dont_follow_back)):
l.write(dont_follow_back[_] + " | " + dont_follow_back_url[_])
l.write("\n")
i+=1
l.write("Número total de usuarios que no te siguen de vuelta: " + str(i))
l.close()
exit()