Skip to content

Instantly share code, notes, and snippets.

@kylehotchkiss
Last active August 29, 2015 14:05
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 kylehotchkiss/c88d0d7538331eec09f2 to your computer and use it in GitHub Desktop.
Save kylehotchkiss/c88d0d7538331eec09f2 to your computer and use it in GitHub Desktop.
Get total of Chase rewards for next statement, because chase doens't tell you.
var transactions = [];
var i = 0;
jQuery(".summary a.expander").each(function( i ) {
transactions.push( this );
});
var getTransactions = (function getTransactions() {
if ( i < transactions.length ) {
var $transaction = jQuery( transactions[i] )
i++
$transaction.click();
console.log( i + " / " + transactions.length );
setTimeout(function() {
getTransactions();
}, 100);
} else {
var total = 0;
console.log("Waiting 20 seconds for chase...")
setTimeout(function() {
jQuery( "td:contains('Total rewards') + td" ).each(function( i ) {
total += parseFloat( jQuery(this).text() );
});
alert( total );
}, 30000)
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment