Skip to content

Instantly share code, notes, and snippets.

@Dykam
Created January 4, 2016 14:01
Show Gist options
  • Save Dykam/a75207ef58de2660f04a to your computer and use it in GitHub Desktop.
Save Dykam/a75207ef58de2660f04a to your computer and use it in GitHub Desktop.
// https://store.steampowered.com/account/history/
if($J('#load_more_button').is(":visible")) {
$J('#load_more_button').click();
console.log("Loading more history...");
} else {
var summary = Array.prototype.map.call(jQuery(".wallet_table_row:has(.wht_type div:contains(In-Game Purchase))"), (i, row) => ({
game: jQuery(".wht_items > div:first-child", row).text(),
val: Number.parseFloat(jQuery(".wht_total", row).text().trim().replace(",", "."))
})).reduce((acc, obj) => (acc[obj.game] = (acc[obj.game] || 0) + obj.val, acc), {})
for(var game in summary) {
console.log(game + ": " + summary[game]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment