wowtoken.app

git clone https://git.emily.sh/wowtoken-app/wowtoken.app.git
Log | Files | Refs | README | LICENSE

commit fa058cc64e061742a04cb7fa8283d78bcd7c0755
parent ef95388185b2c99a002c452907aeaf6a2f614000
Author: Emily Doherty <git@emily.sh>
Date:   Thu, 31 Oct 2024 22:17:57 -0700

Swap to v2 of current API

Diffstat:
Msrc/fetchCurrent.js | 2+-
Msrc/index.html | 2+-
Msrc/index.js | 6+++---
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/fetchCurrent.js b/src/fetchCurrent.js @@ -1,4 +1,4 @@ export default async function fetchCurrent() { - const resp = await fetch("https://data.wowtoken.app/token/current.json"); + const resp = await fetch("https://data.wowtoken.app/v2/current/retail.json"); return await resp.json(); } diff --git a/src/index.html b/src/index.html @@ -7,7 +7,7 @@ <meta name="description" content="Track current and historical gold price trends for the World of Warcraft (WoW) in game token, including the US, EU, TW, and KR regions. Prices updated every minute. Simple, quick, and easy info, no ads or tracking, ever."> <link rel="preconnect" href="https://data.wowtoken.app"> <link rel="dns-prefetch" href="https://data.wowtoken.app"> - <link rel="preload" href="https://data.wowtoken.app/token/current.json" as="fetch" type="application/json" crossorigin="anonymous"> + <link rel="preload" href="https://data.wowtoken.app/v2/current/retail.json" as="fetch" type="application/json" crossorigin="anonymous"> <link rel="preload" href="https://data.wowtoken.app/token/history/us/72h.json" as="fetch" type="application/json" crossorigin="anonymous"> </head> <body> diff --git a/src/index.js b/src/index.js @@ -44,11 +44,11 @@ async function updateTokens(data) { } async function updateRegionalToken(region, data) { - if (currentPriceHash[region] !== data['price_data'][region]) { - currentPriceHash[region] = data['price_data'][region]; + if (currentPriceHash[region] !== data[region][1]) { + currentPriceHash[region] = data[region][1]; if (region === currentRegionSelection) { formatToken(); - datum = new Datum(Date.parse(data['update_times'][region]), data['price_data'][region]); + datum = new Datum(Date.parse(data[region][0]), data[region][1]); if (currentAggregateSelection === 'none' && chart.active()) { await chart.addDataToChart(datum); }