B站刪除抽獎動態(tài)方法總結(jié)

F12 控制臺
var needDelDeled = true,
delay = 1000,
scrolls = 800;
var w='', d='', r=0;
function getLuckyDraw(){
w.css("background-color","#f1c40f");
w = w.parents(".card");
w.css("background-color","#2ecc71");
w[w.length - 1].querySelectorAll(".child-button")[1].click();
setTimeout(clickDel,delay);
}
function getDel(){
d.css("background-color","#8e44ad");
d= d.parents(".card");
d.css("background-color","#2ecc71");
d[d.length - 1].querySelectorAll(".child-button")[1].click();
setTimeout(clickDel,delay);
}
function clickDel(){
//點刪除
$(".popup-content-ctnr")[$(".popup-content-ctnr").length-2].querySelector(".bl-button").click();//點確定
r += scrolls;
$('html,body').animate({ scrollTop:r },30);
$(".fold-text").click()
$(".expand-btn").click();
w = $(".main-content").find('span[click-title="抽獎詳情"]');
d = $(".main-content").find('.deleted-text');
if(d.length && needDelDeled)setTimeout(getDel,delay);
else setTimeout(getLuckyDraw,delay);
}
if(/dynamic/.test(window.location.href) && confirm("是不是要刪除抽獎動態(tài)")){
r += scrolls;
$('html,body').animate({ scrollTop:r },30);
$(".fold-text").click()
$(".expand-btn").click();
w = $(".main-content").find('span[click-title="抽獎詳情"]');//*互動抽獎內(nèi)容定位
d = $(".main-content").find('.deleted-text');//*已刪除內(nèi)容定位
if(d.length && needDelDeled) setTimeout(getDel,delay);
else setTimeout(getLuckyDraw,delay);
}
百度油猴腳本
https://greasyfork.org/zh-TW/scripts/387046-%E6%8A%BD%E5%A5%96%E5%8A%A8%E6%80%81%E5%88%A0%E9%99%A4-%E5%8F%96%E5%85%B3
做個整理半天找,找到代碼瘋狂報錯最后還自己寫了一遍,真的呆呆,評論還吃代碼
油猴腳本省多了,防止以后有s&b和我一樣