Skip to content

Commit

Permalink
feat: Update all items to Wynncraft 2.1 data (#155)
Browse files Browse the repository at this point in the history
This is a really early draft. The version number is to be reverted, the
scripts should move to stable api, and everything should be re-run.
However, this PR helps me track how the beta Wynn API is progressing in
terms of fixing bugs, and noticing any regressions.

---------

Co-authored-by: kristofbolyai <[email protected]>
  • Loading branch information
kristofbolyai and kristofbolyai authored Aug 30, 2024
1 parent f09d7d6 commit ed114f1
Show file tree
Hide file tree
Showing 22 changed files with 161,970 additions and 132,792 deletions.
16 changes: 8 additions & 8 deletions Data-Storage/urls.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
},
{
"id": "dataStaticCharms",
"md5": "3eaf21f82216f1084e332e42f85e36f7",
"md5": "6bcaa84b225619ac166abfff97a10c39",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/charms.json"
},
{
Expand All @@ -115,7 +115,7 @@
},
{
"id": "dataStaticGear",
"md5": "34ea35f18453ffb25d3b398069ab2cf6",
"md5": "2d8937ceec335e6443a66408867edbae",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/gear.json"
},
{
Expand All @@ -125,7 +125,7 @@
},
{
"id": "dataStaticIdentificationKeys",
"md5": "dcd9d021c6bae9948c7f8c3e5a6a6ae6",
"md5": "3ae715fac607e68961fe2bb0a1929a87",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/id_keys.json"
},
{
Expand All @@ -135,12 +135,12 @@
},
{
"id": "dataStaticIngredients",
"md5": "a8c172255d36d9df381fc590d506ce49",
"md5": "7e68e88c927ab269690c70cb31b15f52",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/ingredients.json"
},
{
"id": "dataStaticIngredientsAdvanced",
"md5": "db6bd17b8d83e532567e92ad5164c94a",
"md5": "f0244d7c5658d7093eb0650b0f29a657",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/advanced_ingredients.json"
},
{
Expand Down Expand Up @@ -175,7 +175,7 @@
},
{
"id": "dataStaticMaterials",
"md5": "09758a52d4317cd67bbdd439b110e90d",
"md5": "b5eadd251d028089eff303ee5b66f41a",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/materials.json"
},
{
Expand Down Expand Up @@ -215,12 +215,12 @@
},
{
"id": "dataStaticTomes",
"md5": "41bfd7ed5453320ca299e9a5ebb7cb1d",
"md5": "d95f861780137dde7266dc672b5c71fc",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/tomes.json"
},
{
"id": "dataStaticTools",
"md5": "da5c6b5f3d1d44033e13a93e2dd8ca6e",
"md5": "ecb712e680d77ea7129d1dd01eaeef8f",
"url": "https://raw.githubusercontent.com/Wynntils/Static-Storage/main/Reference/tools.json"
},
{
Expand Down
2 changes: 1 addition & 1 deletion Generators/update_charm_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET_DIR=$(cd $(dirname "$0")/.. >/dev/null 2>&1 && pwd)/Reference
cd $TARGET_DIR

# Download the json file from Wynncraft API
curl -X POST -d '{"type":["charms"]}' -H "Content-Type: application/json" -o charms.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"
curl -X POST -d '{"type":["charm"]}' -H "Content-Type: application/json" -o charms.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"

if [ ! -s charms.json.tmp ]; then
rm charms.json.tmp
Expand Down
2 changes: 1 addition & 1 deletion Generators/update_gear_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET_DIR=$(cd $(dirname "$0")/.. >/dev/null 2>&1 && pwd)/Reference
cd $TARGET_DIR

# Download the json file from Wynncraft API
curl -X POST -d '{"type":["weapon","armour","accessory"]}' -H "Content-Type: application/json" -o gear.json.tmp "https://beta-api.wynncraft.com/v3/item/search?fullResult=True"
curl -X POST -d '{"type":["weapon","armour","accessory"]}' -H "Content-Type: application/json" -o gear.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"

if [ ! -s gear.json.tmp ]; then
rm gear.json.tmp
Expand Down
12 changes: 6 additions & 6 deletions Generators/update_ingredient_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET_DIR=$(cd $(dirname "$0")/.. >/dev/null 2>&1 && pwd)/Reference
cd $TARGET_DIR

# Download the json file from Wynncraft API
curl -X POST -d '{"type":["ingredients"]}' -H "Content-Type: application/json" -o ingredients.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"
curl -X POST -d '{"type":["ingredient"]}' -H "Content-Type: application/json" -o ingredients.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"

if [ ! -s ingredients.json.tmp ]; then
rm ingredients.json.tmp
Expand All @@ -24,15 +24,15 @@ fi
# Sort the items and keys in the json file, since the Wynncraft API is not stable in its order
jq --sort-keys < ingredients.json.tmp > ingredients.json.tmp2
# Minimalize the json file
jq -c < ingredients.json.tmp2 > advanced_ingredients.json
jq -c < ingredients.json.tmp2 > ingredients.json
rm ingredients.json.tmp ingredients.json.tmp2

# To be able to review new data, we also need an expanded, human-readable version
jq '.' < advanced_ingredients.json > advanced_ingredients_expanded.json
jq '.' < ingredients.json > ingredients_expanded.json

# Calculate md5sum of the new ingredient data
MD5=$(md5sum $TARGET_DIR/advanced_ingredients.json | cut -d' ' -f1)
MD5=$(md5sum $TARGET_DIR/ingredients.json | cut -d' ' -f1)

# Update ulrs.json with the new md5sum for dataStaticIngredientsAdvanced
jq '. = [.[] | if (.id == "dataStaticIngredientsAdvanced") then (.md5 = "'$MD5'") else . end]' < ../Data-Storage/urls.json > ../Data-Storage/urls.json.tmp
# Update ulrs.json with the new md5sum for dataStaticIngredients
jq '. = [.[] | if (.id == "dataStaticIngredients") then (.md5 = "'$MD5'") else . end]' < ../Data-Storage/urls.json > ../Data-Storage/urls.json.tmp
mv ../Data-Storage/urls.json.tmp ../Data-Storage/urls.json
2 changes: 1 addition & 1 deletion Generators/update_material_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET_DIR=$(cd $(dirname "$0")/.. >/dev/null 2>&1 && pwd)/Reference
cd $TARGET_DIR

# Download the json file from Wynncraft API
curl -X POST -d '{"type":["materials"]}' -H "Content-Type: application/json" -o materials.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"
curl -X POST -d '{"type":["material"]}' -H "Content-Type: application/json" -o materials.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"

if [ ! -s materials.json.tmp ]; then
rm materials.json.tmp
Expand Down
2 changes: 1 addition & 1 deletion Generators/update_tome_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET_DIR=$(cd $(dirname "$0")/.. >/dev/null 2>&1 && pwd)/Reference
cd $TARGET_DIR

# Download the json file from Wynncraft API
curl -X POST -d '{"type":["tomes"]}' -H "Content-Type: application/json" -o tomes.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"
curl -X POST -d '{"type":["tome"]}' -H "Content-Type: application/json" -o tomes.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"

if [ ! -s tomes.json.tmp ]; then
rm tomes.json.tmp
Expand Down
2 changes: 1 addition & 1 deletion Generators/update_tool_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TARGET_DIR=$(cd $(dirname "$0")/.. >/dev/null 2>&1 && pwd)/Reference
cd $TARGET_DIR

# Download the json file from Wynncraft API
curl -X POST -d '{"type":["tools"]}' -H "Content-Type: application/json" -o tools.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"
curl -X POST -d '{"type":["tool"]}' -H "Content-Type: application/json" -o tools.json.tmp "https://api.wynncraft.com/v3/item/search?fullResult=True"

if [ ! -s tools.json.tmp ]; then
rm tools.json.tmp
Expand Down
2 changes: 1 addition & 1 deletion Reference/advanced_ingredients.json

Large diffs are not rendered by default.

Loading

0 comments on commit ed114f1

Please sign in to comment.