diff --git a/lib/HTTP/BrowserDetect.pm b/lib/HTTP/BrowserDetect.pm index 466a78f..f2f9a8f 100644 --- a/lib/HTTP/BrowserDetect.pm +++ b/lib/HTTP/BrowserDetect.pm @@ -128,6 +128,7 @@ our @ENGINE_TESTS = qw( my @OLD_ROBOT_TESTS = qw( ahrefs altavista + amazonbot apache askjeeves baidu @@ -201,6 +202,7 @@ our @ROBOT_TESTS = ( [ 'vkShare', 'vkshare' ], [ 'W3C_Validator', 'w3c-validator' ], [ 'WhatsApp', 'whatsapp' ], + [ 'Amazonbot', 'amazonbot' ], ); our @MISC_TESTS = qw( @@ -225,6 +227,7 @@ our @ALL_TESTS = ( my %ROBOT_NAMES = ( ahrefs => 'Ahrefs', altavista => 'AltaVista', + amazonbot => 'Amazonbot', 'apache-http-client' => 'Apache HttpClient', apple => 'Apple', 'archive-org' => 'Internet Archive', @@ -347,6 +350,7 @@ my %ROBOT_IDS = ( yandex => 'yandex', yandeximages => 'yandex-images', headlesschrome => 'headless-chrome', + amazonbot => 'amazonbot', ); my %BROWSER_NAMES = ( @@ -3264,7 +3268,8 @@ googleadsbot, googleadsense, googlebotimage, googlebotnews, googlebotvideo, googlefavicon, googlemobile, google, golib, indy, infoseek, ipsagent, linkchecker, linkexchange, lycos, malware, mj12bot, nutch, phplib, puf, rubylib, scooter, specialarchiver, -wget, yandexbot, yandeximages, java, headlesschrome, unknown +wget, yandexbot, yandeximages, java, headlesschrome, amazonbot, +unknown Returns "unknown" when the user agent is believed to be a robot but is not identified as one of the above specific robots. diff --git a/t/05_robot.t b/t/05_robot.t index 5b1b264..46d5134 100644 --- a/t/05_robot.t +++ b/t/05_robot.t @@ -12,7 +12,7 @@ my $detect = HTTP::BrowserDetect->new; my %names = $detect->_robot_names; my @ids = $detect->all_robot_ids; my %fixup = $detect->_robot_ids; -is( scalar @ids, 75, 'correct number of ids' ); +is( scalar @ids, 76, 'correct number of ids' ); foreach my $id (@ids) { subtest $id => sub { diff --git a/t/more-useragents.json b/t/more-useragents.json index 32e61ab..85c1412 100644 --- a/t/more-useragents.json +++ b/t/more-useragents.json @@ -1,4 +1,15 @@ { + "(Amazonbot/0.1; +https://developer.amazon.com/support/amazonbot)" : { + "browser_major" : 0, + "browser_minor" : ".1", + "match" : [ + "robot", + "amazonbot" + ], + "robot" : "amazonbot", + "robot_name" : "Amazonbot", + "robot_version" : "0.1" + }, "AccServer[admin-HDNVR]/5.2.2.24(27991) 64-bit HTTP-Agent" : { "browser_beta" : ".2.24(27991)", "browser_major" : "5",