Skip to content

Instantly share code, notes, and snippets.

@yoni
Last active January 1, 2016 08:19
Show Gist options
  • Save yoni/8117355 to your computer and use it in GitHub Desktop.
Save yoni/8117355 to your computer and use it in GitHub Desktop.
On Lending Club, the aftermarket (i.e. FolioFn) trading form entry is pretty horrible. This little script allows you to set a discount amount (e.g. 90%) and apply it to all loans' asking prices.
var discount = 0.9; // set this to your own discount policy
var outstanding = document.getElementsByClassName('outstanding-principal-accrued-interest');
var askingPrices = document.getElementsByClassName('asking-price');
Array.prototype.slice.call(outstanding).forEach(
function(entry, i) {
var outstandingAmount = entry.textContent.replace(/[$]/g, "");
var askingPrice = (outstandingAmount * discount).toFixed(2);
askingPrices[i].value = askingPrice;
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment