admin管理员组文章数量:1532656
2024年6月6日发(作者:)
WebjxCom提示:通过对照以下的接口说明,我开发出了能够实现基本QQ功能的PHP类,
它整合了以上所有的接口,使用更方便,可以开发QQ机器人、群发广告程序等。
1、研究说明
Tencent在的8000有一个使用HTTP的QQ接口,通过这个接口,可以进行
一些基本的操作,如:登陆、登 出、改变登陆状态(上线、忙碌、离线、隐身)、添加删除
好友、查看好友信息、发送验证信息(接受被加为好友、申请加对方为好友、拒绝被加为好
友)、收发用 户消息、系统信息。
目前我研究的是1.1版本的HTTP QQ协议,研究是微程在的成果上进行的,不敢说有什么超
越,只不过更为详细和准确。
2、接口说明:
接口位置::8000
通信协议:HTTP
数据传输方法:POST
HTTP请求格式:
POST HTTP/1.1
Host: :8000
Content-Type: text/plain; charset=UTF-8
Content-length: 长度
Connection: close
数据
其中长度为 数据 的长度,数据的格式:
VER=1.1&CMD=命令&SEQ=标记&UIN=QQ号&....
以上4个参数是每个请求都必有的。其中,VER表示协议的版本,目前为1.1,据说1.2已经
出来了,这个乱写的话,服务器返回NULL;CMD为 操作的指令,有Login、List、Query_Stat、
GetInfo、AddToList、Ack_AddToList、 DelFromList、Change_Stat、GetMsgEx、CLTMSG、
Logout;SEQ为当前请求的标记,防止重复发送,可以用当前时 间,也可以用随机数;UIN
是当前执行操作的QQ号。不过不同的CMD还需要不同的参数,下面我就公布我的研究成
果。
3、研究方法:
我对目前网上的资料不够满意,就自己写程序,发送多条相同CMD不同参数的请求,根据
服务器的返回,来做判断。感兴趣的朋友可以参考一下,此处可以跳过。
下面我公布我探测的代码(PHP):
$uin = "QQ号";
$pwd = md5("QQ密码");
//登陆测试
$poststring[] =
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M5=1&LC=9
326B87B234E7235";
//注意:登陆测试不能同时进行,必须等到服务器认为QQ断开了,才能够测试,不然结果不
可信
/*******
$poststring[]=
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M5=0&LC=9
326B87B234E7235";
$poststring[]=
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M5=1&LC=9
326B87B234E7235";
$poststring[]=
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M5=2&LC=9
326B87B234E7235";
$poststring[]=
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M5=3&LC=9
326B87B234E7235";
$poststring[]=
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M6=1&LC=9
326B87B234E7235";
$poststring[]=
"VER=1.1&CMD=Login&SEQ=".rand(1000,9000)."&UIN=".$uin."&PS=".$pwd."&M6=1&LC=1
223423545756679";
*******/
//得到好友列表
$poststring[] = "VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin;
$poststring[] = "VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=0";
$poststring[] = "VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=160";
$poststring[] = "VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&UN=0";
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&UN=".rand(1,10);
$poststring[] = VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=0&UN=0";
$poststring[]="VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=160&UN=0
";
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=160&UN=0";
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=".rand(1,200)."&UN=0";
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=".rand(1,200)."&UN=0";
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=".rand(1,200)."&UN=0";
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=0&UN=".rand(1,10);
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=0&UN=".rand(1,10);
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=0&UN=".rand(1,10);
$poststring[]=
"VER=1.1&CMD=List&SEQ=".rand(1000,9000)."&UIN=".$uin."&TN=0&UN=106814";
//得到在线列表
版权声明:本文标题:实现基本QQ功能的PHP类QQ机器人 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dongtai/1717667540a596679.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论