这个元旦假期过的比较奇怪,为了向远方的GF表示忠诚。除了1号和同学吃了个大锅饭之外,尽量做到了大门不出二门不迈,躲在闺房守岁:)。
在家闲着也不能干闲着,总得做点事情,想起前段时间一个师兄交代给我的任务:把若干个串在一起。X国的政策一向比较Bt,你说开个群还要限制人数。H大在深圳有几千校友,一个群怎么可能放的下那么多人。好多在tx工作的师兄,明确告诉:我买通tx的人是不大可能了,搞一个传话筒才是解决之道。
事情虽小,但也着实麻烦。你说要去分析QQ具体数据包,万一哪天tx一高兴把数据给改了,或者接口开放了,也够我郁闷一壶的了。那就找个最简单的办法吧,左一顿baidu,又一顿google. “QQ接口”搜出来的结果绝大多数是关于tx qq的http接口,既然大家那么推崇,那我就从Http接口下手,于是把我以前写的AJAX给拆了,在把所谓的qq接口研究成果给鼓捣在一起,然后去webqq( http://webqq.qq.com)上大抢一遍,那家伙,天昏地暗,相当的&(&(。
代码我是用script写的:
异步AJAX会话类
<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->1
//异步AJAX会话类
2
if(typeof(AjaxSession)=='undefined')
3
varAjaxSession=function()
{
4
5
//创建会话
6
this.CreateSession=function()
7

{
8
if(window.ActiveXObject)
{//IE
9
try
{
10
returnnewActiveXObject('Microsoft.XMLHTTP');
11
}catch(e)
{}
12
13
try
{
14
returnnewActiveXObject('Msxml2.XMLHTTP');
15
}catch(ee)
{}
16
}else
{//Mozilla,Safari
17
vars=newXMLHttpRequest();
18
if(s.readyState==null)
{
19
s.readyState=1;
20
s.addEventListener("load",function()
{
21
s.readyState=4;
22
if(typeof(s.onreadystatechange)=="function")
23
s.onreadystatechange();
24
},false);
25
}
26
27
returns;
28
}
29
30
returnnull;
31
}
32
33
//进行请求
34
this.Request=function(url,params,callback)
35

{
36
37
vars=this.CreateSession();
38
if(null==s)
39
alert("对不起,您的浏览器不支持某些特性。");
40
else
41
s.abort();
42
43
varisAsync=typeof(callback)=='function';
44
varmethod=!params?"GET":"POST";
45
46
if(isAsync)s.onreadystatechange=function()
47

{
48
try
{
49
alert(s.status);
50
if((4==s.readyState)&&(200==s.status||304==s.status))
51
callback(this.Response(s));
52
else
53
alert("请求错误,错误原因:"+s.statusText);
54
}catch(e)
{}
55
}
56
57
s.open(method,url,isAsync);
58
s.setRequestHeader("Connection","Keep-Alive");
59
s.setRequestHeader("Content-Type","text/html;charset=gb2312");
60
//s.setRequestHeader("Content-Type","text/plain;charset=UTF-8");
61
62
if(method=="POST")
63

{
64
s.setRequestHeader("Content-Length",params.length)
65
s.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
66
67
}
68
69
alert(params);
70
s.send(params);
71
72
73
if(!isAsync)
74
returnthis.Response(s);
75
}
76
77
//返回应答信息
78
this.Response=function(s)
79

{
80
if(s.status==200||304==s.status)
81

{
82
if(s.responseXML!=null&&s.responseXML.xml!=null&&s.responseXML.xml!='')
83
returns.responseXML;
84
else
85
returns.responseText;
86
}
87
}
88
89
//对字符串进行编码
90
this.UncCoding=function(s)
91

{
92
varoutput='';
93
for(vari=0;i<s.length;i++)
{
94
output=output+'%'+s.charCodeAt(i);
95
}
96
97
returnoutput;
98
}
99
100
//获取xml结构
101
this.GetDom=function(s)
{
102
vardoc=newActiveXObject('Microsoft.XMLDOM');
103
doc.async=false;
104
doc.loadXML(s);
105
returndoc;
106
}
107
108
returnthis;
109
}
//QQ会话类
<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->1
//会话类
2
if(typeof(QQSession)=='undefined')
3
varQQSession=function()
{
4
this.UIN=0;
5
this.Md5PasswordStr="";
6
this.WebQQUrl="http://tqq.tencent.com:8000/";
7
this.qs=null;
8
this.isLogin=false;
9
this.SeqIndex=null;
10
11
//用户登陆
12
this.Login=function(uin,passwd,vcode,qs)
{
13
varm5=newMD5();
14
this.UIN=uin;
15
this.Md5PasswordStr=m5.calcMD5(passwd);
16
varCmdStr="VER=1.0&CMD=1&SEQ="+this.GetNewSEQ()+"&UIN="+uin+"&PS="+this.Md5PasswordStr+"&STATUS=10&VCODE="+vcode+"&QQSESSION="+qs;
17
18
//if(!this.qs)
19
//this.qs=newAjaxSession();
20
window.frames["proxy"].request(this.WebQQUrl,CmdStr);
21
//this.qs.Request(this.WebQQUrl,CmdStr,this.ShowMsg);
22
23
//document.getElementById("ssl_login").callback=this.ShowMsg;
24
//document.getElementById("ssl_login").src="https://webqq-proxy.qq.com/webqq/l?"+CmdStr;
25
}
26
27
//用户信息
28
this.GetInfo=function()
{
29
varCmdStr="VER=1.0&CMD=10&SEQ="+this.GetNewSEQ()+"&UIN="+this.UIN+"&FUIN="+this.UIN;
30
this.qs.Request(this.WebQQUrl,CmdStr,this.ShowMsg);
31
//window.frames["proxy"].request(this.WebQQUrl,CmdStr);
32
}
33
34
在家闲着也不能干闲着,总得做点事情,想起前段时间一个师兄交代给我的任务:把若干个串在一起。X国的政策一向比较Bt,你说开个群还要限制人数。H大在深圳有几千校友,一个群怎么可能放的下那么多人。好多在tx工作的师兄,明确告诉:我买通tx的人是不大可能了,搞一个传话筒才是解决之道。
事情虽小,但也着实麻烦。你说要去分析QQ具体数据包,万一哪天tx一高兴把数据给改了,或者接口开放了,也够我郁闷一壶的了。那就找个最简单的办法吧,左一顿baidu,又一顿google. “QQ接口”搜出来的结果绝大多数是关于tx qq的http接口,既然大家那么推崇,那我就从Http接口下手,于是把我以前写的AJAX给拆了,在把所谓的qq接口研究成果给鼓捣在一起,然后去webqq( http://webqq.qq.com)上大抢一遍,那家伙,天昏地暗,相当的&(&(。
代码我是用script写的:


<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->1

2

3



4

5

6

7



8



9



10

11



12

13



14

15



16



17

18



19

20



21

22

23

24

25

26

27

28

29

30

31

32

33

34

35



36

37

38

39

40

41

42

43

44

45

46

47



48



49

50

51

52

53

54



55

56

57

58

59

60

61

62

63



64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79



80

81



82

83

84

85

86

87

88

89

90

91



92

93



94

95

96

97

98

99

100

101



102

103

104

105

106

107

108

109



<!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>-->1

2

3



4

5

6

7

8

9

10

11

12



13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28



29

30

31

32

33

34
