Skip to content

Instantly share code, notes, and snippets.

@shockey
Last active July 26, 2017 03:43
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 shockey/4c46b5d5be92a6dcb21ce334ed66603b to your computer and use it in GitHub Desktop.
Save shockey/4c46b5d5be92a6dcb21ce334ed66603b to your computer and use it in GitHub Desktop.
Calculate total value of Discogs wantlist
// Open this page: https://www.discogs.com/mywantlist?page=1&limit=250,
// open your Developer Tools console (right click -> inspect element,
// console tab), then paste the code below into the console.
//
// If you have more than 250 records in your Wantlist, run this
// code on each page of your Wantlist.
console.log("total value is $" +
[].slice.call(document.querySelectorAll("span.price"))
.map(el => parseFloat(el.innerText.slice(1)))
.reduce((p, c) => p + c, 0)
.toFixed(2))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment