1. Go to this page and download the library: Download omines/akismet library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
omines / akismet example snippets
$httpClient = HttpClient::create();
$akismet = new Akismet($httpClient, 'Akismet API key', 'https://www.example.org/');
$message = AkismetMessage::fromRequest($symfonyRequest);
// or
$message = AkismetMessage::fromPSR7Request($psr7Request);
$response = $akismet->check($message);
if ($response->isSpam()) {
if ($response->shouldDiscard()) {
// Akismet believes this to be the most pervasive and worst spam, not even worthy of moderation
} else {
// The message is considered spam, so it should either be refused or manually reviewed
}
}
$response = $this->akismet->usageLimit();
if ($response->getPercentage() > 50) {
@trigger_error('Used up more than half the usage limit', E_USER_WARNING);
}
$response = $this->akismet->activity(limit: 100);
foreach ($response->getMonths() as $month => $activities) {
// Do stuff
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.