wynnbuilder-idk/py_script/ingreds.py

20 lines
573 B
Python
Raw Normal View History

2021-01-19 17:32:27 +00:00
import json
import requests
import numpy as np
2021-01-19 17:32:27 +00:00
#Nothing to ingreds.json
arr = np.array([])
2021-01-19 17:32:27 +00:00
for i in range(4):
response = requests.get("https://api.wynncraft.com/v2/ingredient/search/tier/" + str(i))
arr = np.append(arr, np.array(response.json()['data']))
2021-01-19 17:32:27 +00:00
with open("../ingreds.json", "w") as outfile:
outfile.write(json.dumps(list(arr)))
2021-01-19 17:32:27 +00:00
with open("../ingreds_compress.json", "w") as outfile:
outfile.write(json.dumps(list(arr)))
2021-01-19 17:32:27 +00:00
with open("../ingreds_clean.json", "w") as outfile:
json.dump(list(arr), outfile, indent = 2) #needs further cleaning