官方關閉了借口,批量刪除的小工具全部陣亡。用這個腳本可以快一點點:
?// ==UserScript==
// @name Weibored.js
// @namespace http://vito.sdf.org
// @version 0.1
// @description 刪除所有微博
// @author Vito Van
// @match http://weibo.com/p/*
// @grant none
// ==/UserScript==
'use strict';
var s = document.createElement("script");
s.setAttribute("src","https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js");
s.onload = function(){
setInterval(function(){
$('a[title="刪除此條微博"]')[0].click();
$('a[action-type="ok"]')[0].click();
}, 800);
}
document.head.appendChild(s);
---------------update 20170920-----------------------
'use strict';
var s = document.createElement("script");
s.setAttribute("src","https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js");
s.onload = function(){
setInterval(function(){
if (document.getElementsByClassName("W_layer_close").length > 0){
//error
$('a[action-type="ok"]')[0].click();
console.log ("error" + document.getElementsByClassName("page S_bg1")[0].text)
$(".next")[0].click();
}else{
var aa = $('a[action-type="delComment"]').length;
console.log(aa);
if ( aa > 1){
$('a[action-type="delComment"]')[0].click();
$('a[action-type="ok"]')[0].click();
}else{
$(".next")[0].click();
console.log("next page" + document.getElementsByClassName("page S_bg1")[0].text)
}
}
}, 800);
}
document.head.appendChild(s);
//倒過來刪
'use strict';
var s = document.createElement("script");
s.setAttribute("src","https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js");
s.onload = function(){
setInterval(function(){
var aa = 0;
if (document.getElementsByClassName("W_layer_close").length > 0){
$('a[action-type="ok"]')[0].click();
console.log ("There is error")
$(".prev")[0].click();
}else{
if (Number(document.getElementsByClassName("page S_bg1")[0].text) < 10){
aa = document.getElementsByClassName("page").length - 2;
document.getElementsByClassName("page")[aa].click();
console.log("will go to last");
}else{
aa = $('a[action-type="delComment"]').length;
console.log(aa);
if ( aa > 0){
$('a[action-type="delComment"]')[0].click();
$('a[action-type="ok"]')[0].click();
}else{
$(".prev")[0].click();
console.log(document.getElementsByClassName("page S_bg1")[0].text)
}
}
}
}, 1200);
}
document.head.appendChild(s);
//只刪本頁
'use strict';
var s = document.createElement("script");
s.setAttribute("src","https://lib.sinaapp.com/js/jquery/2.0.3/jquery-2.0.3.min.js");
s.onload = function(){
setInterval(function(){
var aa = 0;
aa = $('a[action-type="delComment"]').length;
console.log(aa);
if ( aa > 0){
$('a[action-type="delComment"]')[0].click();
$('a[action-type="ok"]')[0].click();
}
}, 1200);
}
document.head.appendChild(s);