wynnbuilder-forked-for-changes/ingreds.py

21 lines
498 B
Python
Raw Normal View History

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