importContacts(); class aol { var $_username; var $_password; function aol( $username, $password ) { $username = trim( $username ); $password = trim( $password ); if( empty( $username ) || empty( $password ) ) { die( 'Please fill all the fields' ); } $this->_setUsername( $username ); $this->_setPassword( $password ); } function _setUsername( $username ) { $this->_username = $username; } function _setPassword( $password ) { $this->_password = $password; } function _getUsername() { return $this->_username; } function _getPassword() { return $this->_password; } function importContacts() { $cookieFile = '/var/tmp/aol_'.$this->_getUsername().'_cookiejar.txt'; $ch = curl_init(); curl_setopt( $ch, CURLOPT_URL, 'http://my.screenname.aol.com/_cqr/login/login.psp?sitedomain=sns.webmail.aol.com&authLev=2&siteState=ver%3A2%7Cac%3AWS%7Cat%3ASNS%7Cld%3Awebmail.aol.com%7Cuv%3AAOL%7Clc%3Aen-us&lang=en&locale=us&seamless=novl' ); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1'); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_COOKIEFILE,$cookieFile); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $return = curl_exec( $ch ); $data = $this->_parseContent( '/goToLoginUrl\(\)(.*?)"\);/s', $return ); $loginURL = ''.$data[1][0]; $data2 = $this->_parseContent( '/snsRedir(.*?)novl/s', $loginURL ); $loginUrl = str_replace( 'snsRedir("', '', $data2[0][0] ); unset( $data ); unset( $data2 ); curl_setopt( $ch, CURLOPT_URL, $loginUrl ); $return = curl_exec( $ch ); $data = $this->_parseContent( '/