第一步:电脑 PC 端登录微博。
第二步:打开个人中心。
第三步:打开浏览器开发者工具,选择 Console 控制台面板
第四步:将以下脚本粘贴进去,并敲击回车键。
删除原创原作者是这个,可以直接去他主页,(Sina Visitor System)
删除原创:
function delay(timeout = 100) {
return new Promise((resolve) => {
setTimeout(() => {
resolve()
}, timeout)
})
}
function findOffsetParent (node) {
while (!node.offsetParent.classList.contains('vue-recycle-scroller__item-view')) {
node = node.offsetParent
}
return node.offsetParent
}
const initializedScrollTop = 600
let errorCount = 0
async function readyGo() {
const angleDownList = document.querySelectorAll('i[class="woo-font woo-font--angleDown morepop_action_bk3Fq"]')
const angleDownListLength = angleDownList.length
try {
if (!angleDownList) {
return console.log("微博改 class 或 dom 结构了,请检查!!!")
}
if (!angleDownListLength) {
return console.log("这下清爽多了!!!")
}
// 展开下拉框
angleDownList[1].click()
// 点击删除
const popItems = document.querySelectorAll('div[class="woo-box-flex woo-box-alignCenter woo-pop-item-main"]:nth-child(7)')
for (let i = 0; i < popItems.length; i++) {
const node = popItems[i]
if (node.innerText === "删除") {
node.click()
break
}
}
await delay()
const offsetParent = findOffsetParent(angleDownList[1])
// 确认删除
document.querySelectorAll('button[class="woo-button-main woo-button-flat woo-button-primary woo-button-m woo-button-round woo-dialog-btn"]')[0].click()
await delay()
const doc = document.documentElement || document.body
doc.scrollTo(0,initializedScrollTop + offsetParent.offsetHeight)
errorCount = 0
} catch (e) {
if (errorCount >= 5) {
return console.error('重新执行吧:', e)
}
document.body.click()
errorCount += 1
readyGo()
return
}
if (angleDownListLength >= 2) {
readyGo()
}
}
readyGo()
删除转发:
function delay(timeout = 400) {
return new Promise((resolve) => {
setTimeout(() => {
resolve()
}, timeout)
})
}
function findOffsetParent (node) {
while (!node.offsetParent.classList.contains('vue-recycle-scroller__item-view')) {
node = node.offsetParent
}
return node.offsetParent
}
const initializedScrollTop = 600
let errorCount = 0
async function readyGo() {
const angleDownList = document.querySelectorAll('i[class="woo-font woo-font--angleDown morepop_action_bk3Fq"]')
const angleDownListLength = angleDownList.length
try {
if (!angleDownList) {
return console.log("微博改 class 或 dom 结构了,请检查!!!")
}
if (!angleDownListLength) {
return console.log("这下清爽多了!!!")
}
// 展开下拉框
angleDownList[1].click()
// 点击删除
const popItems = document.querySelectorAll('div[class="woo-box-flex woo-box-alignCenter woo-pop-item-main"]:nth-child(7)')
for (let i = 0; i < popItems.length; i++) {
const node = popItems[i]
if (node.innerText === "删除") {
node.click()
break
}
}
await delay()
const offsetParent = findOffsetParent(angleDownList[1])
// 确认删除
document.querySelectorAll('button[class="woo-button-main woo-button-flat woo-button-primary woo-button-m woo-button-round woo-dialog-btn"]')[0].click()
await delay()
const doc = document.documentElement || document.body
doc.scrollTo(0,initializedScrollTop + offsetParent.offsetHeight)
errorCount = 0
} catch (e) {
if (errorCount >= 5) {
return console.error('重新执行吧:', e)
}
document.body.click()
errorCount += 1
readyGo()
return
}
if (angleDownListLength >= 2) {
readyGo()
}
}
readyGo()