From cd364c00e6192bb25202795ce14ca7253a253738 Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Sat, 18 Sep 2021 08:34:09 +0200 Subject: [PATCH] web-services/steamdb: Add getting stats --- docs/web-services.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/web-services.md b/docs/web-services.md index 3faf212..74d020f 100644 --- a/docs/web-services.md +++ b/docs/web-services.md @@ -33,3 +33,10 @@ :::js Array.from(document.querySelectorAll('#tracklist tr:not(:nth-child(1))')).map(el => el.querySelector('span[id^="title-"]').innerText + " " + el.querySelector('td:nth-child(3)').innerText).join("\n") + +## SteamDB + +### Get stats as json + + :::js + console.log(JSON.stringify(Array.from(document.querySelectorAll('#js-achievements table tbody tr')).map(row => { const cols = row.querySelectorAll('td'); return { name: cols[0].innerText, description: cols[1].querySelector('p.i').innerText, displayName: cols[1].childNodes[0].textContent.replace(/\n/g, ''), hidden: "0", icon: "achievements/" + cols[0].innerText + ".jpg", icongray: "achievements/" + cols[0].innerText + "_gray.jpg" } })))