'; $password = ''; $account_id = 0; // Typically, 0 is checking and 1 is savings $challenges = array('' => '', '' => '', '' => ''); // Grab the challenge question do_curl("https://www.bankofamerica.com/mobile/iphone.do"); do_curl("https://sitekey.bankofamerica.com/sas/signonScreen.do?isMobileDevice=true"); $html = do_curl("https://sitekey.bankofamerica.com/sas/signonMobile.do", "nextAction=screen&customer_Type=MODEL&reason=&portal=&history=&cache=&dltoken=&pmbutton=false&onlineID=$username&rembme=Y"); // Answer the challenge question $found = false; foreach($challenges as $question => $answer) { if(strpos($html, $question) !== false) { $found = true; break; } } if(!$found) die("We couldn't answer the challenge question."); do_curl("https://sitekey.bankofamerica.com/sas/challengeQandAMobile.do", "nextAction=verify&sitekeyChallengeAnswer=$answer&sitekeyDeviceBind=false"); // Enter our password $html = do_curl("https://sitekey.bankofamerica.com/sas/verifyImageMobile.do", "nextAction=signon&passcode=$password"); // Grab the cipher hex $cipher = match('/(.*?)(.*?)(.*?)Pending.*?(-?\$[0-9]+\.[0-9][0-9])/ms', $phtml, $matches); for($i = 0; $i < count($matches[1]); $i++) $trans[] = array('description' => trim(strip_tags($matches[1][$i])), 'amount' => $matches[2][$i], 'date' => date("Y-m-d")); } else { $type = "Cleared"; $trans = array(); $href = match('/\/(cgi-bin.*?Cleared)/', $html, 1); $chtml = do_curl($domain . $href); preg_match_all('/txnid=[0-9]+">(.*?)<\/a>.*?([0-9][0-9]\/[0-9][0-9]\/[0-9][0-9][0-9][0-9]).*?(-?\$[0-9]+\.[0-9][0-9])/ms', $chtml, $matches); for($i = 0; $i < count($matches[1]); $i++) { $date = match('/([01][0-9]\/[0-3][0-9])/', trim(strip_tags($matches[2][$i])), 1) . '/' . date('Y'); $trans[] = array('description' => trim(strip_tags($matches[1][$i])), 'amount' => $matches[3][$i], 'date' => date('Y-m-d', strtotime($date))); } } // And build the RSS feed $out = '' . "\n"; $out .= '' . "\n"; $out .= "\n"; $out .= "$rss_title $type\n"; $out .= "https://www.bankofamerica.com\n"; $out .= "$rss_desc\n"; $out .= "en-us\n"; $out .= "" . date("D, d M Y H:i:s O", strtotime($posted[1][$i] . " 12:00pm")) . "\n"; $out .= "\n"; foreach($trans as $t) { $title = str_replace(" ", "", $t['description']); $title = str_replace("&#39;", "'", $title); $title = preg_replace("/ [ ]+/", "", $title); $title = preg_replace("/[0-9]{5}[0-9]*/", "", $title); $out .= "\n"; $out .= "$title (" . $t['amount'] . ")\n"; $out .= "https://www.bankofamerica.com\n"; $out .= "" . $t['amount'] . " ]]>\n"; $out .= "" . date("D, d M Y H:i:s O", strtotime($t['date'] . " 12:00pm")) . "\n"; $out .= "\n"; } $out .= ""; // Output the results header("Content-type: application/xml"); echo $out; function do_curl($url, $post = null) { static $tmp = null; static $referer = ""; if(is_null($tmp)) $tmp = tempnam(sys_get_temp_dir(), 'boa'); $ch = curl_init($url); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_2; en-us) AppleWebKit/525.13 (KHTML, like Gecko) Version/3.1 Safari/525.13"); curl_setopt($ch, CURLOPT_COOKIEFILE, $tmp); curl_setopt($ch, CURLOPT_COOKIEJAR, $tmp); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); if($referer) curl_setopt($ch, CURLOPT_REFERER, $referer); if(!is_null($post)) { curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); } ob_start(); curl_exec($ch); $html = ob_get_contents(); ob_end_clean(); $referer = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); return $html; } // Quick wrapper for preg_match function match($regex, $str, $i = 0) { return preg_match($regex, $str, $match) == 1 ? $match[$i] : false; }