dxhuii / delweibo Goto Github PK
View Code? Open in Web Editor NEW批量删除微博博文
批量删除微博博文
我当前可见的菜单共 8 项:
0 置顶
1 推广
2 编辑微博
3 转换为粉丝可见
4 转换为好友圈可见
5 转换为自己可见
6 删除
7 复制微博地址
安装脚本后的第 57 行
item[item.length - 3].click();
会命中菜单条目 8 - 3 = 5 转换为自己可见
,会让第一条微博在 转换为自己可见
和 转换为好友圈可见
状态间轮回。
改为
item[item.length - 2].click();
后,命中到 8 - 2 = 6 删除
,顺利删除。
感谢您的辛勤付出。
我是4k分辨率的显示器……真是看了很久才发现那个按钮,太隐蔽了。建议搞大,高亮。
repo 插件的缺陷:
使用方式: 油猴插件+编辑脚本文件(替换我如下源码)
// ==UserScript==
// @name 批量删除新浪微博博文
// @namespace https://github.com/dxhuii/delWeibo
// @version 1.0.10
// @description 批量删除新浪微博
// @author plain
// @match *://weibo.com/*/profile?*
// @match *://weibo.com/u/*
// @match *://weibo.com/fav*
// @match *://weibo.com/u/page/fav/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.onload = () => {
function $(elem) {
return document.querySelector(elem);
}
function $All(elem) {
return document.querySelectorAll(elem);
}
function del() {
for (let i = 0; i < 1000; i++) {
setTimeout(function() {
if(window.location.href.indexOf('//weibo.com/u/page/fav/') !== -1) { // 新
if($('i[title="更多"]')) {
$('i[title="更多"]').click();
$All('.woo-pop-item-main')[0].click();
if($('.woo-dialog-ctrl')) {
$('.woo-dialog-ctrl').querySelectorAll('.woo-button-main')[1].click();
}
i > 160 && window.location.reload();
}
}
if(window.location.href.indexOf('/profile') !== -1) { // 旧
if($('a[action-type="fl_menu"]')) {
$('a[action-type="fl_menu"]').click();
$('a[title="删除此条微博"]').click();
$('a[action-type="ok"]').click();
$('a[title="取消快转"]').click();
}
}
if(window.location.href.indexOf('//weibo.com/fav') !== -1) { // 旧,github网友提供 https://github.com/Syukkic
if($('a[action-type="fl_favorite"]')) {
$('a[action-type="fl_favorite"]').click();
$('a[action-type="ok"]').click();
}
}
if(window.location.href.indexOf('//weibo.com/u/') !== -1) { // 新
if($('i[title="更多"]')) {
$('i[title="更多"]').click();
const item = $All('.woo-pop-item-main');
if(item.length > 3) {
item[item.length - 2].click();
} else {
$('.woo-pop-item-main') && $('.woo-pop-item-main').click();
}
$('.woo-dialog-ctrl') && $('.woo-dialog-ctrl').querySelectorAll('.woo-button-main')[1].click();
if($('.deletedToolbar_toolbarFull_1dOfW')) {
$('.deletedToolbar_toolbarFull_1dOfW').click();
}
i > 160 && window.location.reload();
}
}
}, 1000 * i);
}
}
// 判断如果有cookie 就不再弹窗,直接进行删除微薄
if(document.cookie.indexOf('delWeibo=1') !== -1) {
del();
} else {
var r = confirm("确定好要删除所有微薄了吗,确定好了就点确定吧!");
if (r === true) {
document.cookie = 'delWeibo=1';
del();
}
}
};
})();
if($('a[action-type="fl_menu"]')) {
$('a[action-type="fl_menu"]').click();
if($('a[action-type="fl_del_fast_reported"]')){
$('a[action-type="fl_del_fast_reported"]').click();
}
if($('a[action-type="feed_list_delete"]')){
$('a[action-type="feed_list_delete"]').click();
$('a[action-type="ok"]').click();
}
if($('a[action-type="feed_list_delete_fast_reported"]')){
$('a[action-type="feed_list_delete_fast_reported"]').click();
}
if($('a[title="取消快转"]')){
$('a[title="取消快转"]').click();
}
if($('a[action-type="ok"]')){
$('a[action-type="ok"]').click();
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.