In view of the vitriolic and acerbic nature of the comment section of Glenn's recent postings at UT, many commenters have asked for a filter to remove certain authors' letters from the comment thread. It got so bad, that one commenter was ready to kill:
Baring that, I'd kill for a "ignore" or "filter" option. At least that way I can completely skip the crap and not waste the time and bytes downloading text I'm not going to read.
— KB4Hire
At the time,
I said that I was too busy to take the necessary steps to produce such a filter, but this is the kind of simple programming task that I just can't pass up. So I brushed up my javascript and read a book on Greasemonkey and then wasted a day of my life writing a Q&D
® filter to remove letters from specified authors from comments pages. It turns out it was about as simple as I predicted. And while it doesn't save on downloading, because you have to download the letters before you check and eliminate them, it does mean that you don't have to read the vitriol and invective that some people seem to be incapable of excluding from their writing. This will be a boon to those with peptic ulcers and high blood pressure.
The file is
salonletterfilter.user.js, and, if you already have the Greasemonkey add-on for Firefox installed and active, it can be installed simply by clicking on the file name and selecting "Install" when the Greasemonkey dialog panel appears. If you don't already have
Greasemonkey, install it by clicking on the link. If you're using Internet Explorer, eat your heart out.
Note that there is some manual configuration necessary to make the script functional. After installing the script, open the Greasemonkey "Manage User Scripts" dialog either by right-clicking on the Greasemonkey icon in the status bar at the bottom of your browser window or from the browser's "Tools" menu. Once the dialog panel is open, select "Salon Letter Filter" and click on "Edit". This will open the script in your designated text editor. Then go to the first line of the script that is not a comment (i.e., does not begin with "//") and replace the word "authors" with your kill list. Use a comma to separate individual authors if you want to exclude more than one author. Save the file, and the next time you open a Salon letters page, letters from the authors listed in "killfile" will be deleted.
The configured version is fairly "polite" in that it leaves behind a notice that a letter from a particular author has been deleted, the permalink to the message (as an icon) and the datestamp. As a less polite option, there is also a more vicious version that removes letters completely. To implement this, edit the script and in the last line of the code (//thisLet.innerHTML = "";) delete the "//" at the beginning. Unwanted letters will disappear without a trace.
You can, of course, retrieve deleted letters by editing the "killfile" variable at any time. And there is no need to uninstall the script if you no longer wish to have a killfile. Simply set the variable "killfile" to an empty string ('') and the script will stop. The only thing to keep in mind is that the "killfile" variable is used to create a regular expression so regular expression metacharacters have to have a backslash ("\") in front of them for the script to work properly.
[
Disclaimer: No warranty, expressed or implied, is associated with this script. The use of this script is entirely at the user's risk. This offer void where prohibited by law.]
UPDATE: While we were sleeping, Salon changed the format of their letters pages (obviously to make them less readable than they were before). This means that the old version of the Salon Letters Filter no longer works. I have revised the Greasemonkey script and it is still available through the link above in this posting. In order to install the new version you will have to first delete the old one. For those who are unable to access the script through the link, the
text of the new script is now available.
LATER UPDATE: Salon has mercifully restored the previous letters settings. There is now no need for version 0.0.2 of the Salon Letter Filter and the original version works fine. That is all.
STILL LATER UPDATE: Salon has now changed the format of their letter pages in conformance with their new beta "business model". This change is likely to be permanent. The
text of the new script for the beta layout is now available. The link to a downloadable version of the script no longer works.