-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck.py
83 lines (62 loc) · 2.69 KB
/
check.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import sys
sys.path.insert(0, 'absolute path to site-package directory of the codebase')
# adds the igramscraper module to PATH
from igramscraper.instagram import Instagram # type: ignore
# imports the Instagram class from the module, allows for usage
# type: ignore, removes the pylance false error
from time import sleep
# sleep to mimic user latency
instagram = Instagram()
instagram.with_credentials('username', 'password', 'cachepath')
# access account
# gets the authentication to allow API calls: username, password, cache path of browser, which i think is optional
instagram.login(force=False, two_step_verificator=False)
# logs in to instagram, force decides between whether to refresh the current session, true is refresh allowed
# two step verification for enabled accounts, if there is two step verification you need to do it via CLI, then you can access
# suggestion: create a feeder account for login purposes, to allow for full security
# note: you need to be following the account under inspection, in case the account is private
sleep(2)
username = str(input("Enter Username of The Account You Wish to Check: "))
# result account
# username for the account under inspection
followerList = []
followingList = []
# declares the list for followers and followings
account = instagram.get_account(username)
# gets the instagram account of the specified user
sleep(1)
followerList = instagram.get_followers(account.identifier, 10000, 100, delayed=True)
# parameters: a/c ID, user limit, page data limit, delay between requests
# get x followers of user, y a time with random delay between requests [in order of occurance]
sleep(1)
followingList = instagram.get_following(account.identifier, 10000, 100, delayed=True)
followings = []
followers = []
# declares the list for comparision
for following in followingList['accounts']:
followings.append(following.username)
# adds the username of each account you follow into a list
for follower in followerList['accounts']:
followers.append(follower.username)
# adds the username of each account that follows you into a list
unfollowList = []
followBackList = []
# declares the final list for output
def unfollow():
for person in followings:
if person not in followers:
unfollowList.append(person)
return unfollowList
# checks who doesn't follow back
def followBack():
for person in followers:
if person not in followings:
followBackList.append(person)
return followBackList
# checks who you don't follow back
unfollow()
followBack()
# calls the comparision functions
print("People Who Don't Follow Back: ", unfollowList)
print("People Who You Don't Follow Back: ", followBackList)
# outputs the final data