From f511b6aea8204d01560af0f9a192b7b3f3467ab4 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Wed, 4 Jan 2023 23:31:32 +0300 Subject: [PATCH] add app url --- code.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/code.js b/code.js index f122427..fa004d3 100644 --- a/code.js +++ b/code.js @@ -12,11 +12,12 @@ */ function getData(value) { /* - * Badge Sctruct: - * id: int - * url: str - * name: str - * dropLeft: int + * Sctruct of Badge + * id: int - steam app id + * url: str - game url in store + * card_url: str - card page url + * name: str - steam app name + * dropLeft: int - cards left drops */ // check left cards @@ -29,7 +30,8 @@ function getData(value) { let badgeItem = { id: parseInt(value.childNodes[1].href.split('/')[6]), - url: value.childNodes[1].href, + url: `https://store.steampowered.com/app/${value.childNodes[1].href.split('/')[6]}/`, + card_url: value.childNodes[1].href, name: value.getElementsByClassName('badge_title')[0].innerText.trim().replace(/[\r\n\t]/g, ''), dropLeft: parseInt(cardsDropLeft), }; @@ -79,7 +81,7 @@ function getBadges() { currentPage++; } - setTimeout(() => { exportJson(badges); }, 10000); + setTimeout(() => { exportJson(badges); }, 10000); // FIX IT } getBadges();