add app url

This commit is contained in:
Alexander Popov 2023-01-04 23:31:32 +03:00
parent a498743e45
commit f511b6aea8
1 changed files with 9 additions and 7 deletions

16
code.js
View File

@ -12,11 +12,12 @@
*/ */
function getData(value) { function getData(value) {
/* /*
* Badge Sctruct: * Sctruct of Badge
* id: int * id: int - steam app id
* url: str * url: str - game url in store
* name: str * card_url: str - card page url
* dropLeft: int * name: str - steam app name
* dropLeft: int - cards left drops
*/ */
// check left cards // check left cards
@ -29,7 +30,8 @@ function getData(value) {
let badgeItem = { let badgeItem = {
id: parseInt(value.childNodes[1].href.split('/')[6]), 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, ''), name: value.getElementsByClassName('badge_title')[0].innerText.trim().replace(/[\r\n\t]/g, ''),
dropLeft: parseInt(cardsDropLeft), dropLeft: parseInt(cardsDropLeft),
}; };
@ -79,7 +81,7 @@ function getBadges() {
currentPage++; currentPage++;
} }
setTimeout(() => { exportJson(badges); }, 10000); setTimeout(() => { exportJson(badges); }, 10000); // FIX IT
} }
getBadges(); getBadges();