I'm a member of a forum community where the site owner has set up Akismet as an alternative to a human moderator and then he, the owner, stopped paying attention. Akismet seems to do well with the bots but a couple of human spammers have slipped through and are spamming their links to unrelated products in the forum. The community is frustrated.
The forums are set up as UL elements, with each authored post listed as LIs. Each LI has a few DIVs to display various metadata, including a DIV with an anchor for each author's profile. Roughly, it looks like this...
<div>
<ul>
<li id="[random-id1]">Good Post</li>
<li id="[random-id2]">
<div>
<a class="title" href="spam-post.html">Spam Post Title</a>
</div>
<div id="bad-post-meta">
<a href="member.php/12345-naughtyspammer" class="username" title="Started by NaughtySpammer on Yesterday 05:41 AM">NaughtySpammer</a>
</div>
</li>
<li id="[random-id3]">Good Post</li>
</ul>
</div>
I have used uBlock to remove elements before, but nothing this complex. I'd like for uBlock to search through the a.username elements for known blacklisted spam names and hide their respective LI ancestor element.
How do I hide the offending LI? I suspect that I am missing something simple! The equivalent of display:none; is preferred.
ABP's library of Snippets has a hide-if-contains snippet that looks like it might work but ABP's Snippets appears to be one of the EasyList features that uBlock doesn't support. I can't find a uBlock equivalent to hide-if-contains, which might look like this (if I'm understanding it correctly):
forumsite.com#$#hide-if-contains naughtyspammer li
uBlock says that the #$# syntax is invalid.
forumsite.com##li:has(a.username[title*="NaughtySpammer"])did the trick for my needs, but I wouldn't hate to see other solutions, especially if they are more expedient or would allow multiple spammer names included on one line.