index.html

QQ空间说说批量删除脚本

字数统计: 1.2k阅读时长: 7 min
2019/02/27 Share

QQ空间官方没有提供消除账户内容的选项,删除黑历史只能靠脚本解决。从网上找了两个能用的。

桌面端网页版

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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
function serialize(obj) {
var result = '';
for (var key in obj) {
if (result === '') {
result += key + '=' + obj[key];
} else {
result += '&' + key + '=' + obj[key];
}
}
return result;
}

function ajax(options) {
var xhr = new XMLHttpRequest();
var qs = options.qs;
if (qs) {
var str = '?';
for (var key in qs) {
if (str === '?') {
str += key + '=' + qs[key];
} else {
str += '&' + key + '=' + qs[key];
}
}
options.url += str;
}
xhr.open(options.method, options.url, true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.withCredentials = true;
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && (/^2\d{2}/.test(xhr.status) || xhr.status === 304)) {
QZONE.FP.showMsgbox('删除' + +'条说说成功');
}
}
xhr.send(serialize(options.data))
}

function deleteMsg() {
var data = _preloadCache;
var url = 'https://user.qzone.qq.com/proxy/domain/taotao.qzone.qq.com/cgi-bin/emotion_cgi_delete_v6';
var g_tk = window.g_tk;
var qzonetoken = top.g_qzonetoken;
var hostuin = MOOD.env.loginUin;
var t1_source = 1;
var code_version = 1;
var format = 'fs';
var qzreferrer = 'https://user.qzone.qq.com/' + hostuin + '/infocenter?via=toolbar&_t_=';
var tid = '';
for (var item of data.msglist) {
tid = item.tid;
QZONE.FP.showMsgbox('删除' + data.num + '条说说成功');
(function(opt) {
opt.qzreferrer += Math.random();
ajax(opt);
})({
url: url,
method: 'POST',
qs: {
qzonetoken: qzonetoken,
g_tk: g_tk,
},
data: {
hostuin: hostuin,
tid: tid,
t1_source: t1_source,
code_version: code_version,
format: format,
qzreferrer: qzreferrer,
}
})
}
getMsgList(_preloadCache.total, deleteMsg);
}

function getMsgList(num, cb) {
if (!num) {
num = 20;
}
var preloadcgi = (function() {

var realUin = top.QZONE && top.QZONE.FP && top.QZONE.FP.getQzoneConfig && (top.QZONE.FP.getQzoneConfig('loginUin') > 0 || (top.QZONE.FP.getQzoneConfig('loginUin') + '').length > 4) && top.QZONE.FP.getQzoneConfig('loginUin');
var loginUin = realUin || MOOD.env.getLoginUin();
var queryUin = MOOD.env.uin
//统一都直接进我的说说
var tab = MOOD.env.tab;
var params = OOP.tpl.filter(MOOD.util.getHttpParams('params')).split(',');
var action = MOOD.env.action
//var actionParams = MOOD.util.getHttpParams('poster');
var tid = MOOD.env.tid,
t1_source = MOOD.env.t1_source;
var basePath;
var token;
if (window.g_sdms['taotao.qq.com'] || window.g_sdms['taotao.qzone.qq.com']) {
basePath = g_proto + '//taotao.';
token = QZONE.FP.getACSRFToken('http://taotao.qzone.qq.com');
} else {
basePath = g_proto + '//taotao.';
token = QZONE.FP.getACSRFToken('http://taotao.qq.com');
}
window.g_tk = token;
//var mine_tpl = '//taotao./cgi-bin/emotion_cgi_msglist_v6?uin=&ftype=0&sort=0&pos=0&num=20&replynum=100&g_tk=&callback=_preloadCallback&code_version=1&format=jsonp';
var mine_tpl = basePath + '/cgi-bin/emotion_cgi_msglist_v6?uin=&ftype=0&sort=0&pos=0&num=' + num + '&replynum=100&g_tk=&callback=_preloadCallback&code_version=1&format=jsonp&need_private_comment=1';

var timer_tpl = basePath + '/cgi-bin/emotion_cgi_timershuoshuolist_v6?uin=&pos=0&num=' + num + '&hostuin=&g_tk=&callback=_preloadCallback&code_version=1&format=jsonp';

var detail_tpl = basePath + '/cgi-bin/emotion_cgi_msgdetail_v6?uin=&tid=&t1_source=&ftype=0&sort=0&pos=0&num=' + num + '&g_tk=&callback=_preloadCallback&code_version=1&format=jsonp&need_private_comment=1';
var hot_tpl = '///qzone_v6/act/hotTopic/top20_.js';

var cgi_tpl = '';

switch (tab) {

case 'mine':
cgi_tpl = mine_tpl;
break;
case 'schedule':
cgi_tpl = timer_tpl;
break;
case 'detail':
cgi_tpl = detail_tpl;
break;

}
var url = OOP.tpl.format(cgi_tpl, {
siDomain: top.siDomain,
host: document.domain,
uin: OOP.tpl.html(queryUin),
loginUin: MOOD.env.loginUin,
tid: OOP.tpl.html(tid),
t1_source: OOP.tpl.html(t1_source),
random: Math.floor(Math.random() * 25),
token: token,
location: location
});

return url;
})()

var appendScript = function(src) {

var stag = document.createElement('script');
stag.type = "text/javascript";
stag.src = src;
document.body.appendChild(stag);
stag = null;
}

var onPreloadFinished = function() {

timeStampsPool[3] = (new Date()); //开始渲染首屏页面

//把详情页数据变成数组
if (MOOD.env.tab == 'detail' && window._preloadCache.code === 0) {
window._preloadCache = MOOD.getDetailSuc(window._preloadCache);
}


MOOD.render(window._preloadCache);
var onlyfirstscreen = false;
var proxyoff = false;
try {
onlyfirstscreen = top.location.href.indexOf('onlyfirstscreen=1') > -1;
var proxyoff = top.location.href.indexOf('proxyoff=1') > -1;
if (proxyoff) {
QZONE.FP._t.QZFL.config.xhrProxyEnable = function() { return 0; }
}
} catch (err) {}

timeStampsPool[4] = (new Date()); //渲染首屏完成
// debug mode switch
var debugMode = false;
if (top.location.href.indexOf('concat_debug_on') > -1) {
debugMode = true;
}
var scriptsTmpl = [
'<%for(var i=0;i<scripts.length;i++){%>',
' ' + (window.g_cdn_proto || location.protocol) + '//<%=siDomain%><%=scripts[i]%>?max_age=<%=maxAge%>&ver=<%=jsVer%>',
'<%}%>'
].join('');
//基础库,n久不变的,可做长cache
var libScripts = [];
libScripts.push('/ac/qzfl/appclientlib.js');
libScripts.push('/qzone/app/controls/pager/pager.js');
//业务库,经常变化,cache时间尽量短
var businessScripts = [];
businessScripts.push('/qzone/app/utils/requirejSolution_1.0_qzone.js');
businessScripts.push('/qzone/v8/core/seajs_config.js');
businessScripts.push('/qzone/app/mood_v6/script/app_patch.js');
businessScripts.push('/qzone/app/mood_v6/script/index.js');

appendScript(tmpl(scriptsTmpl, {
siDomain: siDomain,
scripts: (['/c/=' + libScripts.join(',')]),
jsVer: 20130607,
maxAge: 999999

}));

if (debugMode) {
for (var i = 0; i < businessScripts.length; i++) {
appendScript(tmpl(scriptsTmpl, {
siDomain: siDomain,
scripts: ([businessScripts[i]]),
jsVer: MOOD.version,
maxAge: 999999
}))
}
} else {
appendScript(tmpl(scriptsTmpl, {
siDomain: siDomain,
scripts: (['/c/=' + businessScripts.join(',')]),
jsVer: MOOD.version,
maxAge: 999999
}))
}

timeStampsPool[5] = (new Date()); //渲染首屏完成

};

var _loader = new top.QZFL.JSONGetter(preloadcgi, void(0), null, "utf-8");
_loader.onSuccess = function(o) {
window._preloadCache = o;
window.nowMsgNum = _preloadCache.total;
if (cb) {
var lastNum = totalMsgNum - nowMsgNum;
if (lastNum > 0 || totalMsgNum > 0) {
QZONE.FP.showMsgbox('共有' + totalMsgNum + '条说说,已删除' + lastNum + '条,还有' + totalMsgNum + '条');
return cb();
} else {
QZONE.FP.showMsgbox('删除完成!');
return window.location.reload();
}
}
if (isFirst) {
window.totalMsgNum = _preloadCache.total;
QZONE.FP.showMsgbox('共有' + totalMsgNum + '条说说,现在开始删除。。。');
window.isFirst = false;
return getMsgList(_preloadCache.total, deleteMsg);
}
};
_loader.send("_preloadCallback");
}
window.isFirst = true;
window.totalMsgNum = 0;
window.nowMsgNum = 0;
getMsgList();

移动端网页版

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
uin = g_Guest.userid;
setInterval('deleteShuoshuo()', 3000);
function deleteShuoshuo() {
QZ.ajax.request({
url: "/list",
type: "get",
data: {
action: 0,
count: 3,
format: "json",
list_type: "shuoshuo",
res_uin: uin,
},
dataType: "json",
success: function(data) {
data.data.vFeeds.forEach(function(post){
console.log(post);
QZ.ajax.request({
url: "/operation/operation_add",
type: "post",
data: {
opr_type: "delugc",
res_type: 311,
res_id: post.id.cellid,
real_del: 0,
res_uin: uin,
format: "json"
}
})
});
}
});
}

/**
作者:_小B
来源:CSDN
原文:https://blog.csdn.net/picone/article/details/79327328
*/


EOF

CATALOG
  1. 1. 桌面端网页版
  2. 2. 移动端网页版