forked from sherlock-project/sherlock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
site_list.py
32 lines (23 loc) · 981 Bytes
/
site_list.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
"""Sherlock: Supported Site Listing
This module generates the listing of supported sites
which can be found in sites.md
It also organizes all the sites in alphanumeric order
"""
import json
pool = list()
with open("sherlock/resources/data.json", "r", encoding="utf-8") as data_file:
data = json.load(data_file)
with open("sites.md", "w") as site_file:
data_length = len(data)
site_file.write(f'## List Of Supported Sites ({data_length} Sites In Total!)\n')
for social_network in data:
url_main = data.get(social_network).get("urlMain")
pool.append((social_network, url_main))
index = 1
for social_network, url_main in pool:
site_file.write(f'{index}. [{social_network}]({url_main})\n')
index = index + 1
sorted_json_data = json.dumps(data, indent=2, sort_keys=True)
with open("sherlock/resources/data.json", "w") as data_file:
data_file.write(sorted_json_data)
print("Finished updating supported site listing!")