-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain_generate_English_transcript.py
28 lines (22 loc) · 1.5 KB
/
main_generate_English_transcript.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
import jsonHandler, webScraper
import common
def main():
item_names, item_examines, item_options \
= webScraper.scrape_chisel(common.CHISEL_URL["item_main"], common.CHISEL_URL["item_main"])
npc_names, npc_examines, npc_options \
= webScraper.scrape_chisel(common.CHISEL_URL["npc_main"], common.CHISEL_URL["npc_examine"])
object_names, object_examines, object_options \
= webScraper.scrape_chisel(common.CHISEL_URL["object_main"], common.CHISEL_URL["object_examine"])
for name_data in [item_names, npc_names, object_names]:
jsonHandler.dictListToSQL(name_data, [common.COLUMN_NAME_ENGLISH, common.COLUMN_NAME_CATEGORY, common.COLUMN_NAME_SUB_CATEGORY])
for examine_data in [item_examines, npc_examines, object_examines]:
jsonHandler.dictListToSQL(examine_data, [common.COLUMN_NAME_ENGLISH, common.COLUMN_NAME_CATEGORY, common.COLUMN_NAME_SUB_CATEGORY])
for option_data in [item_options, npc_options, object_options]:
jsonHandler.dictListToSQL(option_data, [common.COLUMN_NAME_ENGLISH, common.COLUMN_NAME_CATEGORY, common.COLUMN_NAME_SUB_CATEGORY])
wiki_data = webScraper.scrape_wiki()
jsonHandler.dictListToSQL(wiki_data, [common.COLUMN_NAME_ENGLISH, common.COLUMN_NAME_CATEGORY,
common.COLUMN_NAME_SUB_CATEGORY, common.COLUMN_NAME_SOURCE])
#add manual data
jsonHandler.addAllTSVToSQL(common.CSV_FILE_DIR)
if __name__ == "__main__":
main()