欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

php讀取msn上的用戶信息類

 更新時間:2008年12月05日 00:01:07   作者:  
一個可以獲取msn上用戶信息的代碼
<?php
$msn = new myMSN("h058@test.com", "123");
// MSNv9
class myMSN
{
private $server = "messenger.hotmail.com";
private $port = 1863;
private $nexus = "https://nexus.passport.com/rdr/pprdr.asp";
private $sshLogin = "login.live.com/login2.srf"; //loginnet.passport.com/login2.srf
private $getCode = null;
private $_ip = null;
private $_port = null;
private $connect = null;
private $trID = 1;
private $maxMessage = 4096;
private $userName = null;
private $passWord = null;
private $debug = true;
function myMSN($userName="", $passWord="")
{
if (!empty($userName) && !empty($passWord))
{
$this->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("<div style='color:green;font-size:13px;'>&gt;&gt;&gt;{$data}</div>");
}
}
function get()
{
if ($data = @fgets($this->connect, $this->maxMessage))
{
if ($this->debug)
print("<div style='color:red;font-size:13px;'>&lt;&lt;&lt;{$data}</div>");
return $data;
}
else
{
return false;
}
}
function isConnect()
{
if (!is_null($this->connect))
return true;
else
return false;
}
function close()
{
@fclose($this->connect);
}
function startTalk()
{
if ($this->connect = fsockopen($this->server, $this->port, $errno, $errstr, 2))
$this->verTalk();
}
function verTalk() // MSN 協(xié)議協(xié)商
{
$this->put("VER {$this->trID} MSNP9 CVR0 rn");
$data = $this->get();
//echo $data;
if (false !== strripos($data, "VER"))
$this->envTalk();
}
function envTalk() // 環(huán)境協(xié)商
{
$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); // 分析服務(wù)器
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(); // 重新獲取登陸服務(wù)器地址
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() // 重新獲取服務(wù)器地址
{
$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); // 捕捉服務(wù)器登陸匹配
//print_r($out);
if (isset($out[1]))
{
$this->getLoginCode($out[1]);
}
else
{
//return false;
exit("無法捕捉到登陸服務(wù)器的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());
}
}
?>

相關(guān)文章

  • laravel-admin 中列表篩選方法

    laravel-admin 中列表篩選方法

    今天小編就為大家分享一篇laravel-admin 中列表篩選方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-10-10
  • typecho插件編寫教程(三):保存配置

    typecho插件編寫教程(三):保存配置

    這篇文章主要介紹了typecho插件編寫教程(三):保存配置,本文講解了完善方法、如何保存配置、使用需要注意的問題等內(nèi)容,需要的朋友可以參考下
    2015-05-05
  • CodeIgniter使用smtp服務(wù)發(fā)送html郵件的方法

    CodeIgniter使用smtp服務(wù)發(fā)送html郵件的方法

    這篇文章主要介紹了CodeIgniter使用smtp服務(wù)發(fā)送html郵件的方法,涉及CodeIgniter中email類的使用技巧,需要的朋友可以參考下
    2015-06-06
  • laravel請求參數(shù)校驗方法

    laravel請求參數(shù)校驗方法

    今天小編就為大家分享一篇laravel請求參數(shù)校驗方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-10-10
  • php xml實例 留言本

    php xml實例 留言本

    實例學(xué)習(xí)制作xml留言本代碼。
    2009-03-03
  • PHP爬蟲框架盤點

    PHP爬蟲框架盤點

    大數(shù)據(jù)分析必定少不了數(shù)據(jù)抓取,只有擁有海量的數(shù)據(jù)才能對數(shù)據(jù)進行對比分析。因此,網(wǎng)頁爬蟲是作為程序員必須要懂得技能,下文我將通過文字形式記錄下php的爬蟲框架的一些內(nèi)容。需要的小伙伴可以借鑒一下
    2023-04-04
  • 跟我學(xué)Laravel之安裝Laravel

    跟我學(xué)Laravel之安裝Laravel

    本文主要介紹了安裝Laravel框架的幾種方法,以及Laravel框架的服務(wù)器環(huán)境要求及相關(guān)配置,非常實用,有需要的朋友可以參考下
    2014-10-10
  • PHP中針對區(qū)域語言標記信息的操作

    PHP中針對區(qū)域語言標記信息的操作

    大家都知道Locale 類就是操作區(qū)域語言相關(guān)內(nèi)容的,它無法被實例化,所有全部功能方法都是靜態(tài)的。接下來通過本文給大家分享PHP中針對區(qū)域語言標記信息的操作,需要的朋友參考下吧
    2021-07-07
  • 詳解PHP素材圖片上傳、下載功能

    詳解PHP素材圖片上傳、下載功能

    這篇文章主要介紹了PHP圖片上傳下載功能,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-04-04
  • ThinkPHP模板判斷輸出Defined標簽用法詳解

    ThinkPHP模板判斷輸出Defined標簽用法詳解

    這篇文章主要介紹了ThinkPHP模板判斷輸出Defined標簽用法詳解,需要的朋友可以參考下
    2014-06-06

最新評論