Skip to content

Instantly share code, notes, and snippets.

@oemebamo
Last active December 29, 2015 17:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oemebamo/7703343 to your computer and use it in GitHub Desktop.
Save oemebamo/7703343 to your computer and use it in GitHub Desktop.
Run this script in your browser's Developer Console on the Juno.co.uk Order History page to dazzle when you see the total amount you've spent on your vinyl addiction.
// Run this script in your browser's Developer Console on the Juno.co.uk Order History page to dazzle when you see the total amount you've spent on your vinyl addiction.
// 1. Go to https://secure.juno.co.uk/account/order-history/
// 2. Open developer console
// 3. Paste this script in the console and run it ...
// Support for orders in GBP, EUR
// Result in EUR
// Set var GBPToEURRate to current rate
var total = 0;
var GBPToEURRate = 1.2;
$($('.generic_table tr').get().reverse()).each(function(k, el) {
if (!$(el).find('td.number').length) {
return;
}
var text = $(el).find('td.number').text();
var number = text;
if (number.indexOf('£') >= 0) {
number = parseFloat(number.replace('£', '')) * GBPToEURRate;
}
else if (number.indexOf('€') >= 0) {
number = parseFloat(number.replace('€', ''));
}
else {
console.log("Sorry, I don't know this currency: " + text);
}
total += number;
console.log($($(el).find('td')[3]).text() + ": " + text + " (subtotal: €" + Math.round(total) + ")");
});
console.log("Total: €" + Math.round(total));
@idleberg
Copy link

added an addtional check before total += number – there seem to be no pull requests for gists though, hehe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment