Getting current balance on your Chase Credit Card daily
Post ReplyGetting current balance on your Chase Credit Card dailyPosted: Sunday, May 18, 2014 [20:40:40] - 1
Being able to see your Chase Credit Card daily balances without manually checking Chase website is one of the benefits your Mac may offer. It checks my balances by the end of the day and reports to the small data folder to display it at anytime on any of house Macs and TVs. It could be accessed over the Internet from anywhere if your router's port forwarding is setup properly. Simple AppleScript checks Chase.com website at pre-set time (and re-checks every hour until data updated successfully): -- AppleScript also automatically verifies the "Unrecognized Computer" VIA email tell application "Safari" to activate delay 3 tell application "Safari" end tell tell application "Safari" end tell set logdoreport to "login" tell application "System Events" end tell if logdoreport contains "verify" then -- if chase.com wants to verify your computer end if -- end if chase.com wants to verify your computer tell application "Safari" end tell Save this AppleScript as an .app and run it from cron, daemon or manually. It is probably not the most sophisticated program in the World but it simplifies my life to the point where I have my account balance handy. Perl scripts to work with AppleScript coming-up next. |
RE: Getting current balance on your Chase Credit Card dailyPosted: Sunday, May 18, 2014 [21:00:48] - 2
This Perl script checks if after entering your credentials AppleScript got to the Account Page or further verification required - /Folder_with_your_perl_program/read.chase.login.cgi unless($ENV{'SECURITYSESSIONID'}) { $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local:/usr/local/bin'; } $vr = <STDIN>; ## GET DATA $vr =~ s/\012?\015/\n/gi; if($vr =~ m/When we don\'t recognize the computer/i) {print "do verify";} else {print "login";} Next, read email and find the code sent by Chase /Folder_with_your_perl_program/read.chase.code.cgi unless($ENV{'SECURITYSESSIONID'}) { $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local:/usr/local/bin'; } while(<STDIN>) {$d .= $_;} ## READ THE INPUT $d =~ s/^\s*{.*\n//g; # remove lines starting with braces $d =~ s/\\[\w-]+\b//g; # remove RTF commands $d =~ s/(\n)\s+(\S+)/$1$2/g; # remove extra spaces $d =~ s/([^\\\n]+)\\(\n)/$1$2/g; # get rid of \ at the ends of lines $d =~ s/\\\n//g; # get rid of lines with a \ only $d =~ s/\012?\015/\n/gi; $d =~ s/(.)/(ord($1) > 127) ? "" : $1/egs; $d =~ s#(.*?)(Your\tIdentification\tCode\tis\:)(\t)(\d{8})(\s)(\w+|\W)#$4#ie; if($d =~ m/ /) {($d,$sh) = split(/ /,$d);} elsif($d =~ m/\t/) {($d,$sh) = split(/\t/,$d);} else {$d =~ s/(\d{8}\b)(.*?)/$1/;} $d =~ s/\D//g; if(length($d) > 7 && length($d) < 10) {print "$d";} else {print "bad number";} exit(0); and now, collect and write data file for Credit Card balances /Folder_with_your_perl_program/store.chase.data.cgi unless($ENV{'SECURITYSESSIONID'}) { $ENV{'PATH'} = '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local:/usr/local/bin'; } $vr = <STDIN>; $vr =~ s/\012?\015/\n/gi; if(length($vr) > 10) { open(TXT,">/temp/last.chase.txt"); } ## END VR PRESENT $vr=''; if(-f "/temp/last.chase.txt") { $d = `cat /temp/last.chase.txt`; $d =~ s#(\d{1,2})\,(\d{3})(\.)(\d{2})#$1$2$3$4#g; $d =~ s/\r//g; @all=split(/\n/,$d); foreach $l (@all) { $l =~ s/^\t+//; unless(length($l) > 2) {next;} unless($l =~ m/\t/) {$header = $l; @altabs = split(/\t/,$l); $header =~ s#As of \d{1,2}/\d{1,2}/\d{4}##i; $read{$header}{$key}=$val; } ## FOREACH LINE END foreach $hd (sort keys(%read)) { $totbl .= "<tr><th colspan=2>$hd</th></tr>\n"; $totbl .= "<tr><td>$key</td><td>$read{$hd}{$key}</td></tr>\n"; } ## FOREACH HEAD END $tdate=time; my $finaltime = localtime($tdate); open(TXT,">/data_files/chase.data.txt"); print TXT <<EOH; Chase Freedom<a href="#" onclick="showhide('chaseslate')">: $read{'Account Info'}{'Available Credit'}</a> <div id="chaseslate" style="display:none;"><table border=\"0\" class=\"ktbl\">\n<tr><th colspan=2>Collected: $finaltime</th></tr> $totbl</table></div> EOH close(TXT); } ## END LAST CHASE PRESENT close(TXL); unless($read{'Account Info'}{'Available Credit'} =~ m/\d/) { if(-f "/data_files/chase.data.txt") {unlink "/data_files/chase.data.txt";} } sub num {$a <=> $b;} |