Skip to content

Instantly share code, notes, and snippets.

@smerchek
Created January 15, 2014 22:55
Show Gist options
  • Save smerchek/8446405 to your computer and use it in GitHub Desktop.
Save smerchek/8446405 to your computer and use it in GitHub Desktop.
Sum the items in an Amazon wish list (inspired by "Total up the cost of all items in an Amazon wishlist" https://gist.github.com/chrismbarr/3230548)
var list = $$("span.a-color-price.a-size-base");
var total=0;
for(i=0; i<list.length;i++){
total += parseFloat(list[i].innerText.replace("$",""));
}
alert(list.length+" items for a total of: $"+total.toFixed(2));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment