/
whois.py
74 lines (55 loc) · 2.17 KB
/
whois.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
import requests, sys
from itertools import permutations
import grequests
import concurrent.futures
def create_name_permutations():
new_names = []
first_name = input("first name? ")
last_name = input("last name? ")
dob = input("year of birth? ")
new_names.append(permutations( [first_name, last_name]))
new_names.append(permutations( [first_name[0], last_name]))
new_names.append(permutations( [first_name, last_name[0]]))
new_names.append(permutations( [first_name, last_name, dob]))
new_names.append(permutations( [first_name[0], last_name, dob]))
new_names.append(permutations( [first_name, last_name[0], dob]))
gen_perm = []
for i in range(len(new_names)):
gen_perm.extend(list(map("".join, new_names[i])))
return gen_perm
def main():
names = list(sys.argv[1:])
if len(sys.argv) == 1:
print("usage: python3 whoareyou [name name name etc]", file=sys.stderr)
sys.exit()
elif sys.argv[1] in ['personal', '-p']:
names.pop()
names.extend(create_name_permutations())
green = "\033[92m"
red = "\033[91m"
endc = "\033[0m"
ul = "\033[4m"
green_checkmark = green + "\u2713" + endc
red_x = red + "\u2717" + endc
print(" snooping around..." + '\n')
for name in names:
urls = [
("reddit: ", "https://www.reddit.com/user/" + name),
("twitter: ", "https://twitter.com/" + name),
("instagram: ", "https://instagram.com/" + name),
("facebook: ", "https://facebook.com/" + name),
("youtube: ", "https://youtube.com/" + name),
("imgur: ", "https://imgur.com/" + name),
]
rs = [grequests.get(u[1]) for u in urls]
responses = grequests.map(rs)
if len(responses) > 1:
print( "i found this for", name, ":")
for i in range(len(responses)):
if responses[i].status_code == 200:
print('\t', urls[i][0], '\t', green_checkmark, '\t', urls[i][1])
#else:
# print('\t', urls[i][0], '\t', red_x)
print('\n' + "done.")
if __name__ == '__main__':
main()