Update script to use with-as structure for files. Add number of supported sites to title. Add status message.
parent
d97338c8bb
commit
4ecaad6289
@ -1,15 +1,19 @@
|
|||||||
|
"""Sherlock: Supported Site Listing
|
||||||
|
|
||||||
|
This module generates the listing of supported sites.
|
||||||
|
"""
|
||||||
import json
|
import json
|
||||||
|
|
||||||
raw = open("data.json", "r", encoding="utf-8")
|
with open("data.json", "r", encoding="utf-8") as data_file:
|
||||||
data = json.load(raw)
|
data = json.load(data_file)
|
||||||
|
|
||||||
site_file = open('sites.md', 'w')
|
with open("sites.md", "w") as site_file:
|
||||||
site_file.write('## List of supported sites\n')
|
site_file.write(f'## List Of Supported Sites ({len(data)} Sites In Total!)\n')
|
||||||
|
|
||||||
index = 1
|
index = 1
|
||||||
for social_network in data:
|
for social_network in data:
|
||||||
url_main = data.get(social_network).get("urlMain")
|
url_main = data.get(social_network).get("urlMain")
|
||||||
site_file.write(f'{index}. [{social_network}]({url_main})\n')
|
site_file.write(f'{index}. [{social_network}]({url_main})\n')
|
||||||
index = index + 1
|
index = index + 1
|
||||||
|
|
||||||
site_file.close()
|
print("Finished updating supported site listing!")
|
||||||
|
Loading…
Reference in new issue