Extensible Spam Detection Filters based on snook.ca post
Extensible Spam Detection Filters based on this snook.ca post
Available on Packagist. Autoloading is PSR-4 compatible.
composer require cmdz/spam-canner
Filters are located in the
You can add your own filters as well, they just need to implement
CmdZ\SpamCanner\Filters\FilterInterface and then add them
$filters array that you pass to
$spamScoreIncrease = 1; $currentCommentBody = 'abcd'; $previousCommentBody = 'abcd'; $testLink = 'http://www.site.de'; $spammyTlds = ['de']; $domainParser = new \CmdZ\SpamCanner\Utilities\DomainParser; $filters = [ new BodyInPreviousComment($spamScoreIncrease, $currentCommentBody, $previousCommentBody), new Tlds($spamScoreIncrease, $testLink, $spammyTlds, $domainParser) ]; $utils = new \CmdZ\SpamCanner\Utilities\Utilities; $score = new Score($filters, $utils); $result = $score->getScore(); $expected = 2;
See snook.ca post for the ideas behind each filter.
- Body in Previous Comment
- Body Length
- Check Auth Name for Link
- First Word
- Links in Body
- Status of Previous Comment
- Url Length
- Words Characters in Url
The MIT License (MIT). Please see the License File for more information.