Skip to content

Instantly share code, notes, and snippets.

@codexss
Forked from mariotaku/README.md
Created January 17, 2016 23:15
Show Gist options
  • Save codexss/76623ccb6118a99ce1a4 to your computer and use it in GitHub Desktop.
Save codexss/76623ccb6118a99ce1a4 to your computer and use it in GitHub Desktop.
删除当前屏幕所有微博
var http = new XMLHttpRequest();
var anchors = document.getElementsByTagName("div");
for (i = 0; i < anchors.length; i++) {
var mid = anchors[i].getAttribute("mid");
if (mid) {
console.log("Deleting " + mid);
var url = "/aj/mblog/del?ajwvr=6";
var params = "mid=" + mid;
http.open("POST", url, false);
//Send the proper header information along with the request
http.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http.send(params);
}
}
window.location.reload();
/*
* 在weibo.cn的个人微博列表删除当前屏幕所有微博
* 推荐把屏幕条数设置为50,这样删得多很多
*/
var http = new XMLHttpRequest();
// 找到所有链接
var anchors = document.getElementsByTagName("a");
for (i = 0; i < anchors.length; i++) {
var name = anchors[i].textContent;
// 找出文字为“删除”的链接
if (name == "删除") {
var delLink = anchors[i].getAttribute("href");
console.log("Deleting " + delLink);
// 实际删除操作是删除确认的URL+如下两个参数
var url = delLink + "&type=del&act=delc";
http.open("GET", url, false);
http.send();
}
}
// 重载页面
window.location.reload();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment