16 lines
367 B
Python
16 lines
367 B
Python
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)
|
|
|