直接在控制台复制粘贴如下代码即可;
删除的是当前页面所展示的所有微博
var dom = document.getElementsByTagName("div");
var match = new Array();
var ids = new Array();
for (var i in dom) {
if ((typeof dom[i]) === "object") {
if (dom[i].getAttribute("action-type") === "feed_list_item") {
match.push(dom[i]);
for (k in dom[i].attributes) {
if (dom[i].attributes[k].name === "mid") {
ids.push(dom[i].attributes[k].nodeValue);
}
}
}
}
}
for (var j in ids) {
var xhr = new XMLHttpRequest();
xhr.open('POST', 'http://weibo.com/aj/mblog/del?ajwvr=6');
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.send(encodeURI('mid=' + ids[j]));
xhr.onreadystatechange = callback
function callback() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
console.log('已删除'+ids[j])
}
}
}
}