Last active
July 28, 2016 04:59
-
-
Save junjiah/52ccac6eee1dcefb31293c9d8f30def4 to your computer and use it in GitHub Desktop.
Remove zombie / bots for a Weibo account.
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 i = 0; | |
var pageNumber = 5; | |
function clearBotFans() { | |
function removeFan(fanHrefElement) { | |
fanHrefElement.click(); | |
const okButtons = document.querySelectorAll('a[action-type="ok"]'); | |
if (okButtons) { | |
okButtons[0].click(); | |
} | |
} | |
let fanHrefList = document.querySelectorAll('a[action-type="removeFan"]'); | |
for (let fanHref of fanHrefList) { | |
let fanInfo = fanHref.getAttribute('action-data'); | |
let parts = fanInfo.split('&'); | |
const uid = parts[0].split('=')[1]; | |
const nickname = parts[1].split('=')[1]; | |
if (uid == '2671109275') { | |
removeFan(fanHref); | |
} | |
} | |
} | |
function actionInEveryPage() { | |
clearBotFans(); | |
var nextPageEle = document.querySelector('a[class="page next S_txt1 S_line1"]'); | |
nextPageEle.click(); | |
if (i++ < pageNumber) { | |
window.setTimeout(actionInEveryPage, 5000); | |
} | |
} | |
// Start! | |
actionInEveryPage(); |
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
(function() { | |
function removeFan(fanHrefElement) { | |
fanHrefElement.click(); | |
const okButtons = document.querySelectorAll('a[action-type="ok"]'); | |
if (okButtons) { | |
okButtons[0].click(); | |
} | |
} | |
let fanHrefList = document.querySelectorAll('a[action-type="removeFan"]'); | |
for (let fanHref of fanHrefList) { | |
let fanInfo = fanHref.getAttribute('action-data'); | |
let parts = fanInfo.split('&'); | |
const uid = parts[0].split('=')[1]; | |
const nickname = parts[1].split('=')[1]; | |
if (uid == '2671109275') { | |
removeFan(fanHref); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment