PHP读取MSN上的用户信息类
一个可以获取msn上用户信息的代码 <?php
Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved 地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008 电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134 《中华人民共和国增值电信业务经营许可证》闽B2-20100024 ICP备案:闽ICP备05037997号
private
Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved 地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008 电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134 《中华人民共和国增值电信业务经营许可证》闽B2-20100024 ICP备案:闽ICP备05037997号
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;''>>>>{$data}</div>"); } } function get() { if ($data = @fgets($this->connect, $this->maxMessage)) { if ($this->debug) print("<div style=''color:red;font-size:13px;''><<<{$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 协议协商 { $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 |
||||||||||
凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢! |