Skip to content

berry.utils.CrawlerDetector

Nikos Siatras edited this page Sep 30, 2022 · 7 revisions

CrawlerDetector class implements methods to detect crawlers and bots visiting the website.

Example

The following example initializes a CrawlerDetector object and checks if the current client visiting the website is a crawler.

require_once(__DIR__ . "/utils/CrawlerDetector.php");

$crawlerDetector = new CrawlerDetector();
$crawlerName = $crawlerDetector->getCrawlerName();

if ($crawlerName != "")
{
    print "Cralwer Detected: " . $crawlerDetector;
}
Clone this wiki locally