Skip to content
This repository was archived by the owner on Feb 6, 2025. It is now read-only.

Repository files navigation

bee4/useragent-classifier

Build StatusScrutinizer Code QualityCode CoverageSensiolabInsight

License

This library allow to track and detect who is behind useragents :)

Installing

Latest Stable VersionTotal Downloads

This project can be installed using Composer. Add the following to your composer.json:

{
"require": {
"bee4/useragent-classifier": "~1.0"
}
}

or run this command:

composer require bee4/useragent-classifier:~1.0

Usage

This library is composed of a Detector object and different Bots implementation.

useBee4\UserAgent\Classifier\Detector;
$ua = 'Mozilla/5.0 (compatible; Mail.RU/2.0)';
$bot = Detector::whoIs($ua); //$bot is a Bots\MailRU instance$bot->getBot(); //Here we get `mailru`$bot->getName(); //Here we get `mailru-bot`$ua = 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)';
$bot = Detector::whoIs($ua); //$bot is a Bots\Google instance$bot->getBot(); //Here we get `google`$bot->getName(); //Here we get `google-bot`

About

Working with UserAgent detection and classification

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages