Last active
July 25, 2021 09:40
-
-
Save azrsh/76e72837e76060bdc3243f6e45f01dc7 to your computer and use it in GitHub Desktop.
Amazon の WishList の総額出し太郎
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(() => { | |
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