-
-
Save codexss/76623ccb6118a99ce1a4 to your computer and use it in GitHub Desktop.
删除当前屏幕所有微博
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 在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