ff14-advanced-market-search / saddlebag-with-pockets

This is the Frontend for the FF14 Marketplace

Home Page:https://saddlebagexchange.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Autogenerate updated ffxiv item lists

cohenaj194 opened this issue · comments

We should have a pipeline or script that autogenerates this:

https://github.com/ff14-advanced-market-search/saddlebag-with-pockets/blob/master/app/utils/items/id_to_item.ts

Otherwise we have to replace everything every patch or we get this issue:

image

Its pretty easy to generate it too:

#!/usr/bin/python3
import requests, json

raw_items_names = requests.get(
    "https://raw.githubusercontent.com/ffxiv-teamcraft/ffxiv-teamcraft/staging/libs/data/src/lib/json/items.json"
).json()
item_ids = requests.get("https://universalis.app/api/marketable").json()

marketable_names = {}

for id in item_ids:
    marketable_names[str(id)] = raw_items_names[str(id)]["en"].replace('\u00a0', ' ')


with open("data/id_to_item.json", "w") as writeData:
    json.dump(marketable_names, writeData, indent=2)