https://github.com/sjelfull/crawlerdetect
Use CrawlerDetect to detect 1.000's of bots/crawlers/spiders in Craft.
https://github.com/sjelfull/crawlerdetect
craft craft-plugin craftcms craftcms-plugin
Last synced: about 1 month ago
JSON representation
Use CrawlerDetect to detect 1.000's of bots/crawlers/spiders in Craft.
- Host: GitHub
- URL: https://github.com/sjelfull/crawlerdetect
- Owner: sjelfull
- License: mit
- Created: 2017-04-24T20:31:43.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T20:44:57.000Z (over 8 years ago)
- Last Synced: 2025-01-23T14:18:40.636Z (9 months ago)
- Topics: craft, craft-plugin, craftcms, craftcms-plugin
- Language: PHP
- Size: 73.2 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# CrawlerDetect plugin for Craft CMS
Use CrawlerDetect to detect 1.000's of bots/crawlers/spiders in Craft.

## Installation
To install CrawlerDetect, follow these steps:
1. Download & unzip the file and place the `crawlerdetect` directory into your `craft/plugins` directory
2. Install plugin in the Craft Control Panel under Settings > Plugins
3. The plugin folder should be named `crawlerdetect` for Craft to see it.CrawlerDetect works on Craft 2.4.x and Craft 2.5.x.
## CrawlerDetect Overview
The CrawlerDetect library is a PHP class for detecting bots/crawlers/spiders via the user agent and http_from header. Currently able to detect 1,000's of bots/spiders/crawlers.
## Using CrawlerDetect
Detect if bot/crawler:
```twig
{% if craft.crawlerDetect.isCrawler() %} .. {% endif %}
```Pass a user agent as a string:
```twig
{% if craft.crawlerDetect.isCrawler('Mozilla/5.0 (compatible; Sosospider/2.0; +http://help.soso.com/webspider.htm)') %} .. {% endif %}
```Output the name of the bot that matched (if any)
```twig
{% set matches = craft.crawlerDetect.getMatches() %}
```## Credits
[CrawlerDetect](https://github.com/JayBizzle/Crawler-Detect) by Mark Beech.
Brought to you by [Superbig](https://superbig.co)