Last active
August 29, 2015 14:05
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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