2021-01-19 17:32:27 +00:00
|
|
|
import json
|
|
|
|
import requests
|
2021-05-20 03:35:35 +00:00
|
|
|
import numpy as np
|
2021-01-19 17:32:27 +00:00
|
|
|
#Nothing to ingreds.json
|
|
|
|
|
2021-05-20 03:35:35 +00:00
|
|
|
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))
|
2021-05-20 03:35:35 +00:00
|
|
|
arr = np.append(arr, np.array(response.json()['data']))
|
2021-01-19 17:32:27 +00:00
|
|
|
|
|
|
|
|
2021-05-20 03:35:35 +00:00
|
|
|
with open("../ingreds.json", "w") as outfile:
|
|
|
|
outfile.write(json.dumps(list(arr)))
|
2021-01-19 17:32:27 +00:00
|
|
|
|
2021-05-20 03:35:35 +00:00
|
|
|
with open("../ingreds_compress.json", "w") as outfile:
|
|
|
|
outfile.write(json.dumps(list(arr)))
|
2021-01-19 17:32:27 +00:00
|
|
|
|
2021-05-20 03:35:35 +00:00
|
|
|
with open("../ingreds_clean.json", "w") as outfile:
|
|
|
|
json.dump(list(arr), outfile, indent = 2) #needs further cleaning
|