Last active
March 5, 2022 14:28
-
-
Save AndersMoberg/0d61159cc5f2cf0898e999951ed355c5 to your computer and use it in GitHub Desktop.
Steam Account history export (run in browser dev tools - https://store.steampowered.com/account/history/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rows = document.querySelectorAll("tr") | |
final = [] | |
console.log(rows.length) | |
rows.forEach(element => { | |
onclick = element.attributes["onclick"]; | |
if (onclick == null) { return; } | |
onclick_value = onclick.nodeValue; | |
startId = onclick_value.indexOf("transid=") | |
if (startId == -1) { return; } | |
transid = onclick_value.substr(startId + "transid=".length) | |
if (transid.slice(-1) == "'") { | |
transid = transid.substr(0, transid.length - 1); | |
} | |
license = { id: transid } | |
license.date = (function () { | |
dateText = element.querySelector(".wht_date").innerText; | |
parsedDate = new Date(dateText); | |
return !isNaN(parsedDate) ? parsedDate : dateText; | |
}()); | |
license.cost = element.querySelector(".wht_total").innerText; | |
license.type = element.querySelector(".wht_type div").innerText; | |
license.items = (function () { | |
gameList = element.querySelectorAll(".wht_items div"); | |
return [...gameList].map(gameDom => { return gameDom.innerText }); | |
}()); | |
// | |
final.push(license); | |
}); | |
console.log(final); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment