Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I created this bookmarklet (https://en.wikipedia.org/wiki/Bookmarklet) to remove cow42 from the cheeseheadtv comments section. I've updated it to remove our new troll 'Thompson tWins'.
- basically it just injects some javascript into the page that deletes the html elements containing those posts.
- (function(){
- var comments = document.getElementsByClassName("comment-submitted");
- for (var i = 0; i < comments.length; i++) {
- var data = comments[i].getElementsByTagName("a");
- if (data[0].innerHTML === 'Thompson tWins') {
- data[0].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(data[0].parentNode.parentNode.parentNode.parentNode.parentNode);
- }
- }})()
- In order to use it in the browser it has to be url encoded and pasted into a bookmark. I've pasted the url encoded javascript below, but since it is hard for humans to read you can decode it here (http://meyerweb.com/eric/tools/dencoder/) to make sure the code not doing something shady in your browser, or modify it and re-encode it to your liking. Hell, delete my comments if you want to ignore me, IDK.
- To use it, create a bookmark of any page and edit the bookmark so the url encoded text below is in the URL: field like so. https://www.dropbox.com/s/to75mboakla7gkq/Screenshot%202015-07-07%2008.18.20.png?dl=0 and name it what you like. I named mine cutDaChz as you can see. Enjoy cheeseheadtv again!
- javascript:(function()%7B%0Avar comments %3D document.getElementsByClassName("comment-submitted")%3B%0Afor (var i %3D 0%3B i < comments.length%3B i%2B%2B) %7B%0A%09var data %3D comments%5Bi%5D.getElementsByTagName("a")%3B%0A%09if (data%5B0%5D.innerHTML %3D%3D%3D %27Thompson tWins%27) %7B%0A%09%09data%5B0%5D.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.removeChild(data%5B0%5D.parentNode.parentNode.parentNode.parentNode.parentNode)%3B%0A %7D%0A%7D%7D)()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement