Skip to content

Instantly share code, notes, and snippets.

@mohanraj-r
Last active November 22, 2020 11:04
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 mohanraj-r/92ad772ba63b37ee06315d1d20230eec to your computer and use it in GitHub Desktop.
Save mohanraj-r/92ad772ba63b37ee06315d1d20230eec to your computer and use it in GitHub Desktop.
Amazon order summary
// Executed on "Your Account › Your Orders" page
// TODO:
// * replace console.log with actual summation
// * Pagination - navigate to all pages
const currency = "CDN"
const re = new RegExp('[0-9]+\.[0-9]+')
const list = document.getElementsByClassName("value")
for (let i of list) {
if(i.innerText.startsWith(currency)) {
console.log(i.innerText.match(re));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment