* */ use Friendica\App; use Friendica\Core\Hook; use Friendica\Core\System; use Jaybizzle\CrawlerDetect\CrawlerDetect; function botdetection_install() { Hook::register('init_1', 'addon/botdetection/botdetection.php', 'botdetection_init_1'); } function botdetection_uninstall() { Hook::unregister('init_1', 'addon/botdetection/botdetection.php', 'botdetection_init_1'); } function botdetection_init_1(App $a) { $crawlerDetect = new CrawlerDetect(); if ($crawlerDetect->isCrawler()) { System::httpExit(404, 'Bots are not allowed'); } }