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) {
/*
* 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();