Skip to content

Instantly share code, notes, and snippets.

@azrsh
Last active July 25, 2021 09:40
Show Gist options
  • Save azrsh/76e72837e76060bdc3243f6e45f01dc7 to your computer and use it in GitHub Desktop.
Save azrsh/76e72837e76060bdc3243f6e45f01dc7 to your computer and use it in GitHub Desktop.
Amazon の WishList の総額出し太郎
(() => {
const reducer = (accumulator, currentValue) => accumulator + currentValue;
const items = Array.from(document.getElementById("wl-item-view").getElementsByClassName("a-price-whole"))
.map(item => item.innerHTML.replace(",", ""))
.map(str => parseInt(str));
const total = items.reduce(reducer);
return items.length.toLocaleString() + " items, " + total.toLocaleString() + " yen"
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment