Skip to content

Instantly share code, notes, and snippets.

@onderaltintas
Created June 16, 2016 17:36
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 onderaltintas/5bb275a0e567d922835bd6870799b445 to your computer and use it in GitHub Desktop.
Save onderaltintas/5bb275a0e567d922835bd6870799b445 to your computer and use it in GitHub Desktop.
Counts total money of your steam market listings. Usage: Copy script -> go to my active listings -> right click on page -> inspect element -> console -> paste -> enter
// Usage: Copy script -> community -> market -> go to my active listings -> right click on page ->
// inspect element -> console -> paste -> enter
var sumAll = function()
{
var pageContent = document.body.innerHTML;
var regX = /\((.?[0-9].[0-9][0-9]).*?\)/g
var matches = pageContent.match(regX)
var total = 0;
for(var i = 0; i < matches.length;i++)
{
var val = matches[i].split(" ")[0].replace("(","").replace(",",".");
total+=parseFloat(val);
console.log("Sum:"+total+" + "+matches[i])
}
alert("You will earn "+total+" if you sell all items");
}
sumAll();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment