Created
October 10, 2017 02:37
-
-
Save RaoHai/a863a18dc4bb13ff2ea48ee9e8051644 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
[].slice.call(document.querySelectorAll('.follow_item')) | |
.map(function(item) { | |
var d = item.getAttribute('action-data'); | |
var data = /uid=(\d+)&/g.exec(d); | |
var uid = data && data[1]; | |
if (uid) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('POST', 'http://weibo.com/aj/f/addblack?ajwvr=6'); | |
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); | |
xhr.send('f=1&uid=' + uid); | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment