Last active
June 20, 2018 04:36
-
-
Save bearlyrunning/6bb22ce9e465e1708da3ce44349de670 to your computer and use it in GitHub Desktop.
Zhihu cleanup script - unvote
This file contains hidden or 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
// Unvote everything on https://www.zhihu.com/people/username/activities | |
// Based on this https://gist.github.com/z11i/2daf934c60d1c4088a07c4df7779f10d | |
function unvote() { | |
window.scrollTo(0, document.body.scrollHeight); | |
setTimeout(function() { | |
console.log('unfollowed'); | |
// Cover different button types | |
let list = document.querySelectorAll('.Button.VoteButton.VoteButton--up.is-active'); | |
let list2 = document.querySelectorAll('.Button.LikeButton.is-active.ContentItem-action'); | |
for (var i = 0; i < list.length; i++) { | |
list[i].click(); | |
} | |
for (var i = 0; i < list2.length; i++) { | |
list2[i].click(); | |
} | |
unvote() | |
}, 1000) | |
} | |
unvote() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment