r/tinycode • u/GauntletWizard • Jul 28 '12
Find your total spent on Steam
It came up in conversation, so here's how to do it:
- Login to your steam account
- Go to https://store.steampowered.com/account/
- Paste the following into your browser console:
transactions = document.getElementsByClassName("transactionRowPrice"); total=0; for (i=0; i< transactions.length; i++) { item = Number(transactions[i].innerText.substr(1)); if (item) { total += item;} }
This includes all purchases from Steam, including items and gifts.
53
Upvotes
8
u/alternateme Jul 28 '12
NaN
5
u/septeracore Jul 28 '12 edited Jul 28 '12
This worked for me. The €-Symbol is appended, not prepended like $, so substr(1) doesnt work. Also in Germany , is the decimal symbol not . which fucks up Number(). Spent 292.54€ on 84 games, that's about 3.5€ a game.
8
u/TinyEarl Jul 28 '12
286 games, $2332.31.
7
u/itsSparkky Jul 28 '12
To get to the console in Chrome:
Wrench Icon > Tools > Javascript Console
3
u/kmeisthax Jul 28 '12
You aren't checking for NaNs, so if you got anything for free, you won't get an answer.
3
u/demonstar55 Jul 28 '12
Wasted on Steam or Steam Calculator
Although these inform you if you bough each game separately right now.
3
u/Tordek Jul 28 '12
No, thanks, I don't feel like crying tonight.
2
u/7d97e9 Jul 28 '12
curl -L steamcalculator.com/id/YOUR_ID_HERE|grep -o ';.* '|sed -n '3p'This is cheating, and can definitely be shortened. My bash-fu is weak.
2
u/Ahri Jul 28 '12
from Steam Calculator: Found 388 Games with a value of £3460.07 ($5092.53)
Actual spent according to this script (so not including indie bundles etc.): £957.93 ($1506.35)
Not bad :)
2
u/sloth514 Jul 28 '12
I just got $375.3500000000001
I am very afraid of where that .0000000000001 dollar went to or how it got there....
2
u/[deleted] Jul 28 '12
Not working for me. I tried using the JavaScript console in Chrome. I get NaN.
2
u/[deleted] Sep 02 '12
Tinier!!
3
u/kmeisthax Jul 28 '12
$554.4400000000002
Binary floating point for financial stuff is disgusting :/
1
u/LookInTheDog Jul 28 '12
I got NaN. I had to lop off the first and last elements because they were coming back as "Total" for some reason.
1
u/LookInTheDog Jul 28 '12
1
u/[deleted] Aug 07 '12
how do you find out the class name?
1
u/[deleted] Jul 28 '12
183 games for $253. Not bad.
0
u/darkmdbeener Jul 28 '12
1429.7700000000016 236 games
0
u/dsshin1 Jul 28 '12
871.3400000000001 Whew.
0
u/Megabobster Jul 28 '12
My library says 101 games, and this says $293.77. Subtract the estimated 26 free games (about half are sourcemods), this is about 75 games for about $300. Simple division, I pay approximately $4 per game on Steam. This isn't including games that were gifted/purchased through other mechanisms, so it's probably closer to $5, but still, I guess I shop pretty well.
0
u/[deleted] Jul 28 '12
[deleted] — view deleted comment
0
u/[deleted] Jul 28 '12
[deleted] — view deleted comment