代码
class qq { public $sid; public $http; public $qq_num; function __construct() { $this->http = new http_no_cookie; } function login($qq_num, $qq_pwd) { echo $data = $this->http->get("http://pt.3g.qq.com/"); $action = preg_match("/action=\"(.+)?\"/", $data, $matches); $action = $matches[1]; $params = array(); $params["login_url"] = "http://pt.3g.qq.com/s?aid=nLogin"; $params["sidtype"] = 1; $params["loginTitle"] = "手机腾讯网"; $params["bid"] = 0; $params["qq"] = $qq_num; $params["pwd"] = $qq_pwd; $params["loginType"] =1; echo $data = $this->http->post($action, http_build_query($params)); if(preg_match("/http:\/\/vc.gtimg.com\//",$data,$matches)){ echo "需要输入验证码"; return 0; exit; } if(preg_match("/密码错误/",$data,$matches)){ echo "密码错误"; return 1; exit; } $action = preg_match("/sid=(.+?)&/", $data, $matches); $this->sid = $matches[1]; return $this->sid; } function sendMsg($to_num, $msg, $sid = 0) { $sid = $sid ? $sid : $this->sid; if (!$sid) exit("sid值未传入进去"); $params = array(); $params["msg"] = $msg; $params["u"] = $to_num; $params["saveURL"] = 0; $params["do"] = "send"; $params["on"] = 1; $params["aid"] = "发送"; $url = "http://q16.3g.qq.com/g/s?sid=" . $sid; echo $data = $this->http->post($url, http_build_query($params)); return $data; } function getMsg($qq_num = 0, $sid = 0) { $qq_num = $qq_num ? $qq_num : $this->qq_num; if (!$qq_num) exit("qq_num值未传入进去"); $sid = $sid ? $sid : $this->sid; if (!$sid) exit("sid值未传入进去"); $url = "http://q16.3g.qq.com/g/s?sid=" . $sid . "&3G_UIN=" . $qq_num . "&saveURL=0&aid=nqqChat"; $data = $this->http->get($url); preg_match("/name=\"u\" value=\"(\d+)\"/", $data, $matches); $result["qq"] = $matches[1]; $data = explode("<form", $data); $data = $data[0]; preg_match_all("/<p>(.+)?<\/p>/", $data, $matches); unset($matches[1][0]); $result["content"] = $matches[1]; return $result; } function logout($sid){ $url="http://pt.3g.qq.com/s?sid=".$sid."&aid=nLogout"; echo $url; echo $this->http->get($url); } function getFriendsList($qq_num = 0, $sid = 0){ $result=array(); $qq_num = $qq_num ? $qq_num : $this->qq_num; if (!$qq_num) exit("qq_num值未传入进去"); $sid = $sid ? $sid : $this->sid; if (!$sid) exit("sid值未传入进去"); $url="http://q16.3g.qq.com/g/s?aid=nqqchatMain&sid=".$sid."&myqq=".$qq_num; while(true){ $i=1; $url.="&p=".$i; $data=$this->http->get($url); preg_match_all("/u=(.+?)&/",$data,$matches); foreach($matches[1] as $key=>$value){ $result[]=$value; } if(count($matches[1])<13) break; $i++; } return $result; } }
2. http.class.php
<?php class http { private $curl; public $user_agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13"; public function get($url) { $this->curl = curl_init(); curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($this->curl, CURLOPT_URL, $url); curl_setopt($this->curl, CURLOPT_HEADER, 1); curl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($this->curl); curl_close($this->curl); return $data; } public function post($url, $params) { $this->curl = curl_init(); curl_setopt($this->curl, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($this->curl, CURLOPT_URL, $url); curl_setopt($this->curl, CURLOPT_HEADER, 1); //curl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($this->curl, CURLOPT_POST, 1); curl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $params); curl_setopt($this->curl, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($this->curl); curl_close($this->curl); return $data; } } ?>
陳述
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

AI Hentai Generator
免費產生 AI 無盡。

熱門文章
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
2 週前By尊渡假赌尊渡假赌尊渡假赌
倉庫:如何復興隊友
4 週前By尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
4 週前By尊渡假赌尊渡假赌尊渡假赌
擊敗分裂小說需要多長時間?
3 週前ByDDD
R.E.P.O.保存文件位置:在哪里以及如何保護它?
3 週前ByDDD

熱工具

Dreamweaver CS6
視覺化網頁開發工具

SecLists
SecLists是最終安全測試人員的伙伴。它是一個包含各種類型清單的集合,這些清單在安全評估過程中經常使用,而且都在一個地方。 SecLists透過方便地提供安全測試人員可能需要的所有列表,幫助提高安全測試的效率和生產力。清單類型包括使用者名稱、密碼、URL、模糊測試有效載荷、敏感資料模式、Web shell等等。測試人員只需將此儲存庫拉到新的測試機上,他就可以存取所需的每種類型的清單。

Safe Exam Browser
Safe Exam Browser是一個安全的瀏覽器環境,安全地進行線上考試。該軟體將任何電腦變成一個安全的工作站。它控制對任何實用工具的訪問,並防止學生使用未經授權的資源。

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

mPDF
mPDF是一個PHP庫,可以從UTF-8編碼的HTML產生PDF檔案。原作者Ian Back編寫mPDF以從他的網站上「即時」輸出PDF文件,並處理不同的語言。與原始腳本如HTML2FPDF相比,它的速度較慢,並且在使用Unicode字體時產生的檔案較大,但支援CSS樣式等,並進行了大量增強。支援幾乎所有語言,包括RTL(阿拉伯語和希伯來語)和CJK(中日韓)。支援嵌套的區塊級元素(如P、DIV),