Patterico’s Pontifications » How to Make the Comments of Annoying Commenters Disappear from Your Screen

Source: Patterico’s Pontifications » How to Make the Comments of Annoying Commenters Disappear from Your Screen

All credit for this ought to go to felipe and milhouse.

(1) I can’t reprint the script here in these comments because it uses characters that confuse the readers’ browsers and that will make the script incomplete. So instead of printing it here in comments for people to cut and paste, here’s instead a link to a tiny simple ASCII text file called “patterico_blocker_script.txt” that anyone can right-click and select “save link as” to download and save the file to his/her own computer. Feel free to rename it if you like. [But I can put it in this post using the <pre> </pre>”preformatted” tags. – Karl]

javascript:(function($)
{'use%20strict';var%20n=/^(name1|name2|name3|name4)/i,aa=$(".fn"),
end=aa.length,i,el,v,p;for(i=0;i<end;i++){el=$(aa[i]);v=el.text();if(n.test(v))
{p=el.parents(".comment-body");p.children().not("span,br,.reply").hide();
p.css("padding","1em%200%200%203em");p.css("cursor","pointer");
p.click(function(){if($(this).children()[0].style.display==="none")
{$(this).children().not("span,br,.reply").show();$(this).css("padding","");}else{$(this).children().not("span,br,.reply").hide();$(this).css("padding","1em%200%200%203em");}});}}}(jQuery));

(2) Once downloaded and saved, open that file with any text editor. Since it has “.txt” as its extension, whatever your computer is set up to use as its default ASCII editor will likely open it when you double-click the file name. I use the old reliable Windows Notepad for this type of dirt-simple text-file editing; other programs might add formatting and stuff you don’t want or need unless you’re careful to specify ASCII.

(3) Look (or text-search) for “name1″ and replace that with the screenname of the first commenter you wish to block. Extras don’t matter; you can leave “name4″ in the script, for example, if you only want to block three commenters. But likewise, if you wish to block more than four, just start adding those names in that same part of the script, using the up-and-down symbol | as the separator.
(I’m not sure if this is case-sensitive and haven’t tested that; I just copied the commenters’ names from here and pasted them verbatim to replace “name1,” etc., one at a time.)

(4) When you’re done editing, re-save the text file on your own computer. Again highlight the whole text string as edited (CTRL+A), copy it to your clipboard (CTRL+C), and then go back to your browser window.

(5) Now you’re then going to create a new bookmark. The difference from bookmarks you usually create and use is that this isn’t a bookmark that tells your browser to go to some particular URL. Instead, it stays at the URL you’re already at, and simply runs the commands in the script on whatever webpage you currently have open.

Every popular browser has multiple different ways to create and edit bookmarks. It might be easier just to bookmark some random webpage the way you’re usually used to doing, and then to simply edit that one, than to try to create one from scratch.

But to create one from scratch, for me, using the Chrome browser, the easiest way was simply to open an empty browser tab, and type CTRL+D to open the small text box for new bookmarks. There will be a suggested title of “New tab”; ignore that. Instead, left-click on the “Edit” button so that a slightly bigger window will pop up with more options. I decided to name my new bookmark “Patterico+script” and I decided to save it in my “Bookmarks bar” (which I have enabled regularly), but not inside one of my folders (because I don’t want to have to open a bookmarks folder every time I use this new bookmark — which is quite a bit, after every page reload.) Below the “Name” text field is one for “URL.” Delete whatever Google’s suggested, and instead paste (CTRL+V) your edited text script into that tiny field-box, like this. Don’t worry that it spills over and can’t all be read, it won’t matter. Click the Save box at the bottom.

(6) Now every time you visit a page with comments at Patterico.com, you can tap that bookmark and it will execute the script, which tells your browser to redraw that page leaving out the text — but not the comment numbers or commenters’ names — from all the objectionable commenters you’ve blacklisted, like this.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s