您好,欢迎访问一九零五行业门户网

php读取msn上的用户信息_PHP教程

php读取msn上的用户信息username = $username;
//$this->password = urlencode($password);
$this->password = $password;
$this->starttalk();
}
}
function put($data)
{
if ($this->isconnect())
{
fputs($this->connect, $data);
$this->trid++;
if ($this->debug)
print(
>>>{$data}
);
}
}function get()
{
if ($data = @fgets($this->connect, $this->maxmessage))
{
if ($this->debug)
print(
}
function starttalk()
{
if ($this->connect = fsockopen($this->server, $this->port, $errno, $errstr, 2))
$this->vertalk();
}
function vertalk() // msn 协议协商
{
$this->put(ver {$this->trid} msnp9 cvr0 rn);
$data = $this->get();
//echo $data;
if (false !== strripos($data, ver))
$this->envtalk();
}
function envtalk() // 环境协商
{
$this->put(cvr {$this->trid} 0x0409 winnt 5.0 i386 msnmsgr 7.0.0816 msmsgs {$this->username} rn);
$data = $this->get();
//echo $data;
if (false !== strripos($data, cvr))
$this->reqtalk();
}
function reqtalk() // 请求确认
{
$this->put(usr {$this->trid} twn i {$this->username} rn);
$data = $this->get(); // xfr 3 ns 207.46.107.41:1863 0 65.54.239.210:1863 xfr 3 ns 207.46.107.25:1863 u d
//echo $data;
if (false !== strripos($data, xfr))
{
list(, , , $serv) = explode( , $data); // 分析服务器
list($ip, $port) = explode(:, $serv); // 分析ip和端口
$this->_ip = $ip;
$this->_port = $port;
$this->relink($ip, $port);
}
else
{
//echo $data; // usr 3 twn s ct=1205292058,rver=5.0.3270.0,wp=fs_40sec_0_compact,lc=1033,id=507,ru=http:%2f%2fmessenger.msn.com,tw=0,kpp=1,kv=4,ver=2.1.6000.1,rn=1lgjbfil,tpf=b0735e3a873dfb5e75054465196398e0
list(, , , , $this->getcode) = explode( , trim($data));
//echo $data;
if (empty($this->sshlogin))
$this->relogintalk(); // 重新获取登陆服务器地址
else
$this->getlogincode($this->sshlogin);
}
}
function relink($server, $port) // 重置连接
{
$this->connect = null;
$this->server = $server;
$this->port = $port;
$this->trid = 1;
$this->starttalk();
}
function relogintalk() // 重新获取服务器地址
{
$ch = curl_init($this->nexus);
curl_setopt($ch, curlopt_header, 1);
curl_setopt($ch, curlopt_nobody, 1);
curl_setopt($ch, curlopt_followlocation, 1);
curl_setopt($ch, curlopt_ssl_verifypeer, 0);
curl_setopt($ch, curlopt_returntransfer, 1);
$header = curl_exec($ch);
//print_r($header);
curl_close($ch);
preg_match ('/dalogin=(.*?),/', $header, $out); // 捕捉服务器登陆匹配
//print_r($out);
if (isset($out[1]))
{
$this->getlogincode($out[1]);
}
else
{
//return false;
exit(无法捕捉到登陆服务器的url);
}
}
function getlogincode($slogin) // 获取登陆代码
{
//echo($this->getcode);
if (!is_null($this->getcode))
{
$ch = curl_init(https:// . $slogin);
$logininfo = array(
authorization: passport1.4 rgverb=get,orgurl=http%3a%2f%2fmessenger%2emsn%2ecom,sign-in= . $this->username . ,pwd= . $this->password . , . $this->getcode,
host: login.passport.com
);
curl_setopt($ch, curlopt_httpheader, $logininfo);
//print_r($logininfo);
//$this->getcode = null;
curl_setopt($ch, curlopt_header, 1);
curl_setopt($ch, curlopt_nobody, 1);
curl_setopt($ch, curlopt_followlocation, 1);
curl_setopt($ch, curlopt_ssl_verifypeer, 0);
curl_setopt($ch, curlopt_returntransfer, 1);
$header = curl_exec($ch);
//print_r($header);
preg_match (/from-pp='(.*?)'/, $header, $out);
//print_r($out);
if (isset($out[1]))
{
$this->loginaction($out[1]);
}
else
{
//return false;
exit(无法捕捉到登陆代码的信息);
}
}
else
{
return false;
}
}
function loginaction($logincode) // 登陆工作
{
$this->put(usr {$this->trid} twn s {$logincode} rn); // usr |trid| sso s |t=code|
$data = $this->get();
//echo $data;
//print_r($data);
//$this->put(syn {$this->trid} 0 rn);
//$this->put(chg {$this->trid} nln rn);
//print_r($this->get());
}
}
?>
http://www.bkjia.com/phpjc/630440.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/630440.htmltecharticlephp读取msn上的用户信息 ?php $msn = new mymsn(h058@test.com, 123); // msnv9 class mymsn { private $server = messenger.hotmail.com; private $port = 1863; private $nexus = htt...
其它类似信息

推荐信息