Skip to content

Instantly share code, notes, and snippets.

@Ugrend
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ugrend/580bc3a0d74bded28dad to your computer and use it in GitHub Desktop.
Save Ugrend/580bc3a0d74bded28dad to your computer and use it in GitHub Desktop.
get total spent on steam
// ==UserScript==
// @name transactions
// @namespace store.steampowered.com/account
// @include https://store.steampowered.com/account/
// @version 1
// @grant none
// ==/UserScript==
var elements = document.getElementsByClassName('transactionRowPrice');
var total = 0
for (var i = 0; i < elements.length; i++){
var ammount = elements[i].innerHTML;
ammount = ammount.replace('$','');
if (ammount == 'Free' || ammount == 'Total'){
ammount = 0;
}
total += parseInt(ammount)
//console.log(ammount);
}
alert(total);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment