init
This commit is contained in:
15
get_data/get-events.py
Normal file
15
get_data/get-events.py
Normal file
@@ -0,0 +1,15 @@
|
||||
import subprocess
|
||||
import json
|
||||
|
||||
with open("./sports.json", "r") as f:
|
||||
sports = json.load(f)
|
||||
|
||||
ret = {}
|
||||
for sport in sports:
|
||||
stdout = subprocess.check_output(f'./get-events.sh {sport}', shell=True)
|
||||
events = json.loads(stdout)
|
||||
ret[sport] = events
|
||||
|
||||
with open("./events.json", "w") as f:
|
||||
json.dump(ret, f, indent=4, ensure_ascii=False, sort_keys=True)
|
||||
|
||||
Reference in New Issue
Block a user