4,250
社区成员
发帖
与我相关
我的任务
分享
function checklogin( $user, $password )
{
$headers_login = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CIBA)',
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Connection' => 'keep-alive',
);
$url = "http://passport.sohu.com/sso/login.jsp";
$url = $url."?userid=".urlencode( $user );
$url = $url."&password=".md5( $password );
$url = $url."&appid=1000&persistentcookie=0&isSLogin=1&s=".time( )."&b=1&w=1366&pwdtype=1&v=26";
$ch = curl_init($url);
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers_login);
curl_setopt( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HEADER,1);
$contents = curl_exec( $ch );
// echo $contents;exit;
curl_close($ch);
//第二步:再次跳转到邮箱首面
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CIBA)',
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Connection' => 'keep-alive',
);
$ch = curl_init('https://mail.sohu.com/bapp/81/main');
curl_setopt($ch, CURLOPT_TIMEOUT, TIMEOUT);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_COOKIEFILE,COOKIEJAR);
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIEJAR);
curl_setopt($ch,CURLOPT_HEADER,1);
$str2 = curl_exec($ch);
echo $str2;exit; //此处echo的值为空白,为什么登陆失败?
curl_close($ch);
if ( strpos( $contents, "success" ) === false )
{
return 0;
}
return 1;
}
<?php
define( "COOKIEJAR", tempnam( ini_get( "upload_tmp_dir" ), "cookie" ) ); //定义COOKIES存放的路径,要有操作的权限
define( "TIMEOUT", 1000 ); //超时设定
/**
* sohu
*/
class sohu
{
function checklogin( $user, $password )
{
/* 第一步 */
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => '*/*',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
// 'Cookie' => 'IPLOC=CN3100; SUV=1104061651306300; WapMailCookie=1302080810726|helloqhq@sohu.com|1|58.246.67.38|66910e28127184478ad2f84ea5ed1436; lastdomain=1303434229|aGVsbG9xaHFAc29odS5jb218|sohu.com|1; last_update_time=1302167850; JSESSIONID=abcR5Ln9pd1Zwfj0ROY8s; ppmdig=1302240196000000f21d8ff27978dab636f40ab3b6f988e7',
'Proxy-Connection' => 'keep-alive'
);
// $cookie1='IPLOC=CN3100; SUV=1104061651306300; lastdomain=1303356714|aGVsbG9xaHFAc29odS5jb218|sohu.com|1';
$url = "http://mail.sohu.com";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
// curl_setopt($ch,CURLOPT_COOKIEFILE,COOKIEJAR);
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HEADER,1);
$contents = curl_exec( $ch );
curl_close($ch);
// $this->readcookies( COOKIEJAR, $cookies );
// echo "<pre>";
// print_r($cookies);
// echo "</pre>";
// exit;
/* 第二步 */
$headers = array(
'Host' => 'passport.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => '*/*',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
// 'Cookie' => 'IPLOC=CN3100; SUV=1104061651306300; lastdomain=1303356714|aGVsbG9xaHFAc29odS5jb218|sohu.com|1',
'Proxy-Connection' => 'keep-alive'
);
// $cookie1='IPLOC=CN3100; SUV=1104061651306300; lastdomain=1303356714|aGVsbG9xaHFAc29odS5jb218|sohu.com|1';
$url = "http://passport.sohu.com/sso/login.jsp";
$url = $url."?userid=".urlencode( $user );
$url = $url."&password=".md5( $password );
$url = $url."&appid=1000&persistentcookie=0&isSLogin=1&s=".time( )."&b=2&w=1366&pwdtype=1&v=26";
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
curl_setopt($ch,CURLOPT_COOKIEFILE,COOKIEJAR);
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HEADER,1);
$contents = curl_exec( $ch );
curl_close($ch);
// echo $contents;
$this->readcookies( COOKIEJAR, $cookies );
// echo "<pre>";
// print_r($cookies);
// echo "</pre>";
// exit;
/* 第三步 */
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
// 'Cookie' => "IPLOC=CN3100; SUV=1104061651306300; WapMailCookie=1302080810726|".$user."|1|58.246.67.38|66910e28127184478ad2f84ea5ed1436; last_update_time=".time()."; crossdomain=1302224576101",
'Proxy-Connection' => 'keep-alive'
);
$ch = curl_init('http://mail.sohu.com/');
curl_setopt($ch, CURLOPT_TIMEOUT, TIMEOUT);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_COOKIEFILE,COOKIEJAR);
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIEJAR);
curl_setopt($ch,CURLOPT_HEADER,1);
$str2 = curl_exec($ch);
// echo $str2;exit;
curl_close($ch);
// echo $str2;
// $this->readcookies( COOKIEJAR, $cookies );
// echo "<pre>";
// print_r($cookies);
// echo "</pre>";
// exit;
/* 第四步 */
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
'Proxy-Connection' => 'keep-alive'
);
$ch = curl_init('http://mail.sohu.com/servlet/LoginServlet?appid=1000');
curl_setopt($ch, CURLOPT_TIMEOUT, TIMEOUT);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_COOKIEFILE,COOKIEJAR);
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIEJAR);
curl_setopt($ch,CURLOPT_HEADER,1);
$str3 = curl_exec($ch);
curl_close($ch);
// echo $str3;exit;
if ( strpos( $contents, "success" ) === false )
{
return 0;
}
return 1;
}
function getcontacts( $user, $password, &$result )
{
if ( !$this->checklogin( $user, $password ) )
{
return 'checklogin失败';
}
$cookies = array( );
$bRet = $this->readcookies( COOKIEJAR, $cookies );
// echo "<pre>";
// print_r($cookies);
// echo "</pre>";
// exit;
if ( !$bRet && !$cookies['JSESSIONID'] )
{
return 'readcookies失败';
}
$ch = curl_init( );
curl_setopt( $ch, CURLOPT_COOKIEFILE, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
'Proxy-Connection' => 'keep-alive'
);
curl_setopt( $ch, CURLOPT_URL, "http://mail.sohu.com/bapp/81/main" );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// curl_setopt( $ch, CURLOPT_USERAGENT, USERAGENT );
// curl_setopt($ch, CURLOPT_HEADER, 1);
$content = curl_exec( $ch );
echo $content;exit;
curl_close( $ch );
$bRet = $this->_parsedata( $content, $result );
return $bRet;
}
function _parsedata( $content, &$ar )
{
$ar = array( );
if ( !$content )
{
return '获取内容为空';;
}
$data = json_decode( $content );
unset( $content );
foreach ( $data->listString as $value )
{
if ( preg_match_all( "/[a-z0-9_\\.\\-]+@[a-z0-9\\-]+\\.[a-z]{2,6}/i", $value->email, $matches ) )
{
$emails = array_unique( $matches[0] );
unset( $matches );
foreach ( $emails as $email )
{
$ar[$email] = $value->name;
}
}
}
return $ar;
}
function readcookies( $file, &$result )
{
$fp = fopen( $file, "r" );
while ( !feof( $fp ) )
{
$buffer = fgets( $fp, 4096 );
$tmp = split( "\t", $buffer );
$result[trim( $tmp[5] )] = trim( $tmp[6] );
}
return 1;
}
}
$contacts = new sohu;
$res = $contacts->getcontacts('****@sohu.com','****',$result);
print_r($res);
?>
<?php
define( "COOKIEJAR", tempnam( ini_get( "upload_tmp_dir" ), "cookie" ) ); //定义COOKIES存放的路径,要有操作的权限
define( "TIMEOUT", 1000 ); //超时设定
/**
* sohu
*/
class sohu
{
function checklogin( $user, $password )
{
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
'Proxy-Connection' => 'keep-alive'
);
$url = "http://passport.sohu.com/sso/login.jsp";
$url = $url."?userid=".urlencode( $user );
$url = $url."&password=".md5( $password );
$url = $url."&appid=1000&persistentcookie=0&isSLogin=1&s=".time( )."&b=1&w=1366&pwdtype=1&v=26";
$ch = curl_init($url);
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers_login);
curl_setopt( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HEADER,1);
$contents = curl_exec( $ch );
// echo $contents;exit;
curl_close($ch);
//第二步:再次跳转到邮箱首面
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Keep-Alive' => '115',
'Accept-Encoding' => 'gzip,deflate',
'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
'Referer' => 'http://mail.sohu.com/',
'Proxy-Connection' => 'keep-alive'
);
$ch = curl_init('http://mail.sohu.com/servlet/LoginServlet?appid=1000');
curl_setopt($ch, CURLOPT_TIMEOUT, TIMEOUT);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_COOKIEFILE,COOKIEJAR);
curl_setopt($ch, CURLOPT_COOKIEJAR, COOKIEJAR);
curl_setopt($ch,CURLOPT_HEADER,1);
$str2 = curl_exec($ch);
// echo $str2;exit;
curl_close($ch);
if ( strpos( $contents, "success" ) === false )
{
return 0;
}
return 1;
}
function getcontacts( $user, $password, &$result )
{
if ( !$this->checklogin( $user, $password ) )
{
return 'checklogin失败';
}
$cookies = array( );
$bRet = $this->readcookies( COOKIEJAR, $cookies );
if ( !$bRet && !$cookies['JSESSIONID'] )
{
return 'readcookies失败';
}
$ch = curl_init( );
curl_setopt( $ch, CURLOPT_COOKIEFILE, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
// $headers = array(
// 'Host' => 'mail.sohu.com',
// 'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12 (.NET CLR 3.5.30729)',
// 'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
// 'Accept_Language' => 'zh-cn,zh;q=0.5',
// 'UA-CPU' => 'x86',
// 'Keep-Alive' => '115',
// 'Accept-Encoding' => 'gzip,deflate',
// 'Accept-Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7',
// 'Referer' => 'http://mail.sohu.com/',
// 'Proxy-Connection' => 'keep-alive'
// );
curl_setopt( $ch, CURLOPT_URL, "http://mail.sohu.com/bapp/81/main" );
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// curl_setopt( $ch, CURLOPT_USERAGENT, USERAGENT );
// curl_setopt($ch, CURLOPT_HEADER, 1);
$content = curl_exec( $ch );
echo $content;exit; //这里echo后会跳到登陆页面,并没有进入个人邮箱首页,为什么?
curl_close( $ch );
$bRet = $this->_parsedata( $content, $result );
return $bRet;
}
function _parsedata( $content, &$ar )
{
$ar = array( );
if ( !$content )
{
return '获取内容为空';;
}
$data = json_decode( $content );
unset( $content );
foreach ( $data->listString as $value )
{
if ( preg_match_all( "/[a-z0-9_\\.\\-]+@[a-z0-9\\-]+\\.[a-z]{2,6}/i", $value->email, $matches ) )
{
$emails = array_unique( $matches[0] );
unset( $matches );
foreach ( $emails as $email )
{
$ar[$email] = $value->name;
}
}
}
return $ar;
}
function readcookies( $file, &$result )
{
$fp = fopen( $file, "r" );
while ( !feof( $fp ) )
{
$buffer = fgets( $fp, 4096 );
$tmp = split( "\t", $buffer );
$result[trim( $tmp[5] )] = trim( $tmp[6] );
}
return 1;
}
}
$contacts = new sohu;
$res = $contacts->getcontacts('*****@sohu.com','*****',$result);
print_r($res);
?>
<?php
define( "COOKIEJAR", tempnam( ini_get( "upload_tmp_dir" ), "cookie" ) ); //定义COOKIES存放的路径,要有操作的权限
define( "TIMEOUT", 1000 ); //超时设定
/**
* sohu
*/
class sohu
{
function checklogin( $user, $password )
{
$headers_login = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; MS-RTC LM 8; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; CIBA)',
'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */*',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'UA-CPU' => 'x86',
'Connection' => 'keep-alive'
);
$url = "http://passport.sohu.com/sso/login.jsp";
$url = $url."?userid=".urlencode( $user );
$url = $url."&password=".md5( $password );
$url = $url."&appid=1000&persistentcookie=0&isSLogin=1&s=".time( )."&b=1&w=1366&pwdtype=1&v=26";
$ch = curl_init($url);
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers_login);
curl_setopt( $ch, CURLOPT_COOKIEJAR, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HEADER,1);
$contents = curl_exec( $ch );
// echo $contents;exit;
curl_close($ch);
if ( strpos( $contents, "success" ) === false )
{
return 0;
}
return 1;
}
function getcontacts( $user, $password, &$result )
{
if ( !$this->checklogin( $user, $password ) )
{
return 'checklogin失败';
}
$cookies = array( );
$bRet = $this->readcookies( COOKIEJAR, $cookies );
if ( !$bRet && !$cookies['JSESSIONID'] )
{
return 'readcookies失败';
}
$ch = curl_init( );
curl_setopt( $ch, CURLOPT_COOKIEFILE, COOKIEJAR );
curl_setopt( $ch, CURLOPT_TIMEOUT, TIMEOUT );
$headers = array(
'Host' => 'mail.sohu.com',
'User-Agent' => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2',
'Accept' => 'text/javascript, text/html, application/xml',
'Accept_Language' => 'zh-cn,zh;q=0.5',
'Accept_Encoding' => 'gzip,deflate',
'Accept_Charset' => 'GB2312,utf-8;q=0.7,*;q=0.7\r\n',
'Keep-Alive' => '115',
'Connection' => 'keep-alive',
'X-Requested-With'=> 'XMLHttpRequest',
'Content_Type' => 'application/x-www-form-urlencoded; charset=UTF-8',
'Referer' => 'http://mail.sohu.com/'
);
curl_setopt( $ch, CURLOPT_URL, "https://mail.sohu.com/bapp/81/main#addressList" );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt( $ch, CURLOPT_USERAGENT, USERAGENT );
curl_setopt($ch, CURLOPT_HEADER, 1);
$content = curl_exec( $ch );
echo $content;exit;
curl_close( $ch );
$bRet = $this->_parsedata( $content, $result );
return $bRet;
}
function _parsedata( $content, &$ar )
{
$ar = array( );
if ( !$content )
{
return '获取内容为空';;
}
$data = json_decode( $content );
unset( $content );
foreach ( $data->listString as $value )
{
if ( preg_match_all( "/[a-z0-9_\\.\\-]+@[a-z0-9\\-]+\\.[a-z]{2,6}/i", $value->email, $matches ) )
{
$emails = array_unique( $matches[0] );
unset( $matches );
foreach ( $emails as $email )
{
$ar[$email] = $value->name;
}
}
}
return $ar;
}
function readcookies( $file, &$result )
{
$fp = fopen( $file, "r" );
while ( !feof( $fp ) )
{
$buffer = fgets( $fp, 4096 );
$tmp = split( "\t", $buffer );
$result[trim( $tmp[5] )] = trim( $tmp[6] );
}
return 1;
}
}
$contacts = new sohu;
$res = $contacts->getcontacts('****','****',$result);
print_r($res);
?>