検索
ホームページphp教程php手册新版php获取MSN好友列表,邀请MSN好友

新版php获取MSN好友列表,邀请MSN好友

Jun 13, 2016 am 10:38 AM
classerrormsnphpprivateリスト友達新しいバージョン得る招待する

error_reporting(7);
 
class msn
 
{
 
    private $startcomm = 0;
 
    private $username = ;
 
    private $password = ;
 
    private $commend = ;
 
    private $domain = ;
 
    private $socket = ;
 
    private $challenge = ;
 
    private $status = array();
 
    private $data = array();
 
 
 
    function set_account($username, $password)
 
    {
 
        $this->username = $username;
 
        $this->password = $password;
 
    }
 
 
 
    function getData(){
 
        $buffer="";
 
        while (!feof($this->socket)) {
 
            $buffer .= fread($this->socket,1024);
 
            if (preg_match("//",$buffer)) {
 
                break;
 
            }
 
        }
 
        $this->checkData($buffer);
 
    }
 
 
 
    function getData2() {
 
        $buffer="";
 
        while (!feof($this->socket)) {
 
            $buffer .= fread($this->socket,1024);
 
            if (preg_match("/ /",$buffer)) {
 
                break;
 
            }
 
        }
 
        $this->checkData($buffer);
 
    }
 
 
 
    function checkData($buffer) {
 
        if (preg_match("/lc=(.+?)/Ui",$buffer,$matches)) {   
 
            $this->challenge = "lc=" . $matches[1];
 
        }
 
 
 
        if (preg_match("/(XFR 3 NS )([0-9.:]+?) (.*) ([0-9.:]+?)/is",$buffer,$matches)) {
 
            $split = explode(":",$matches[2]);
 
            $this->startcomm = 1;
 
            $this->msn_connect($split[0],$split[1]);
 
        }
 
 
 
        if (preg_match("/tpf=([a-zA-Z0-9]+?)/Ui",$buffer,$matches)) {
 
            $this->nexus_connect($matches[1]);
 
        }
 
 
 
        $split = explode(" ",$buffer);
 
        for ($i=0;$i 
            $detail = explode(" ",$split[$i]);
 
            if ($detail[0] == "LST") {
 
                if(isset($detail[2])) $this->data[] = array($detail[1], urldecode($detail[2]));
 
            }
 
        }
 
        $this->status = array(200, $this->data);
 
        //echo $buffer;
 
    }
 
 
 
    function msn_connect($server,$port) {
 
        if ($this->socket) {
 
            fclose($this->socket);
 
        }
 
        $this->socket = @fsockopen($server,$port, $errno, $errstr, 20);
 
        if (!$this->socket) {
 
            $this->status = array(500,MSN验证服务器无法连接);
 
            return false;
 
        } else {
 
            $this->startcomm++;
 
            $this->send_command("VER " . $this->startcomm . " MSNP8 CVR0",1);
 
            $this->send_command("CVR " . $this->startcomm . " 0x0409 win 4.10 i386 MSNMSGR 6.2 MSMSGS " . $this->username,1);
 
            $this->send_command("USR " . $this->startcomm . " TWN I " . $this->username,1);
 
        }
 
    }
 
 
 
    function send_command($command) {
 
        $this->commend = $command;
 
        $this->startcomm++;      
 
        fwrite($this->socket,$command . " ");
 
        $this->getData();
 
    }
 
 
 
    function nexus_connect($tpf) {
 
        $arr[] = "GET /rdr/pprdr.asp HTTP/1.0 ";
 
        $curl = curl_init();
 
        curl_setopt($curl, CURLOPT_URL, "https://nexus.passport.com:443/rdr/pprdr.asp");
 
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
 
        curl_setopt($curl, CURLOPT_VERBOSE, 0);
 
        curl_setopt($curl, CURLOPT_HEADER,1);
 
        curl_setopt($curl, CURLOPT_HTTPHEADER, $arr);
 
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
 
        $data = curl_exec($curl);
 
        curl_close($c

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

MantisBT

MantisBT

Mantis は、製品の欠陥追跡を支援するために設計された、導入が簡単な Web ベースの欠陥追跡ツールです。 PHP、MySQL、Web サーバーが必要です。デモおよびホスティング サービスをチェックしてください。

Dreamweaver Mac版

Dreamweaver Mac版

ビジュアル Web 開発ツール

SublimeText3 Mac版

SublimeText3 Mac版

神レベルのコード編集ソフト(SublimeText3)

PhpStorm Mac バージョン

PhpStorm Mac バージョン

最新(2018.2.1)のプロフェッショナル向けPHP統合開発ツール

WebStorm Mac版

WebStorm Mac版

便利なJavaScript開発ツール