Skip to content

Instantly share code, notes, and snippets.

@bearlyrunning
Last active June 20, 2018 04:36
Show Gist options
  • Save bearlyrunning/6bb22ce9e465e1708da3ce44349de670 to your computer and use it in GitHub Desktop.
Save bearlyrunning/6bb22ce9e465e1708da3ce44349de670 to your computer and use it in GitHub Desktop.
Zhihu cleanup script - unvote
// 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