Skip to content

Common interface for antispam and antibot services written in PHP.

Notifications You must be signed in to change notification settings

korotin/spamdetect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spam Detect

Build Status Scrutinizer Code Quality Code Coverage Code Climate

Spam Detect is a common interface for different antispam and antibot services written in PHP. Main purpose of the project is to help block spam in comments, reviews or blogposts.

Usage

Usage is quite simple.

// Initialize probe (each service should have it's own probe).
$probe = new spamdetect\probes\BlogSpam;

// Initialize main detector class with probe object.
$detector = new spamdetect\Detector($probe);

// Create message object.
$message = new spamdetect\Message;
$message->
    setIP('1.1.1.1')->
    setName('IAmSpammer')->
    setBody('spam spam spam')->
    setOrigin('http://my.site.com/');

// Analyze message with given probe.
$result = $detector->analyze($message);

var_dump([
    // Spam flag.
    $result->isSpam(),
    // Reason (if any).
    $result->getReason(),
]);

Please refer to source code for more detailed information.

About

Common interface for antispam and antibot services written in PHP.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages