Skip to content

Instantly share code, notes, and snippets.

@jinscoe-zz
Forked from ChrisMBarr/gist:3230548
Last active December 11, 2015 00:59
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 jinscoe-zz/4520211 to your computer and use it in GitHub Desktop.
Save jinscoe-zz/4520211 to your computer and use it in GitHub Desktop.
Made the original script into a user script to be used with GreaseMonkey or Tamper monkey. Remove the alert. Instead this outputs the total at the top of the list along side the list controls.
// ==UserScript==
// @name Amazon Total Cost of Wishlist
// @namespace http://www.amazon.com/registry/wishlist/
// @version 0.1
// @description Total cost of amazon wishlist
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js
// @match http://www.amazon.com/registry/wishlist/*
// @match http://www.amazon.com/gp/wishlist/*
// @copyright 2012+, Jack
// ==/UserScript==
var list = $("#item-page-wrapper .list-items table tbody .lineItemMainInfo .lineItemPart strong");
var total=0;
for(i=0; i<list.length;i++){
total += parseFloat(list[i].innerText.replace("$",""));
}
$("span#printThisList").after(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