diff --git a/README.md b/README.md index d6e7ff7..a9c978c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,6 @@ end ## Supported - [Ahrefs](https://ahrefs.com/robot) -- [Alexa](https://support.alexa.com/hc/en-us/articles/360046707834-What-are-the-IP-addresses-for-Alexa-s-Certify-and-Site-Audit-crawlers-) - [Amazon AdBot](https://adbot.amazon.com/index.html) - [Applebot](https://support.apple.com/en-us/HT204683) - [Baidu spider](http://help.baidu.com/question?prod_en=master&class=498&id=1000973) diff --git a/lib/legitbot.rb b/lib/legitbot.rb index 1b9687a..c2cd1ff 100644 --- a/lib/legitbot.rb +++ b/lib/legitbot.rb @@ -4,7 +4,6 @@ require_relative 'legitbot/botmatch' require_relative 'legitbot/ahrefs' -require_relative 'legitbot/alexa' require_relative 'legitbot/amazon' require_relative 'legitbot/apple' require_relative 'legitbot/baidu' diff --git a/lib/legitbot/alexa.rb b/lib/legitbot/alexa.rb deleted file mode 100644 index e9ba9f4..0000000 --- a/lib/legitbot/alexa.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -module Legitbot # :nodoc: - # https://support.alexa.com/hc/en-us/articles/360046707834-What-are-the-IP-addresses-for-Alexa-s-Certify-and-Site-Audit-crawlers- - # https://support.alexa.com/hc/en-us/articles/200462340 - # https://support.alexa.com/hc/en-us/articles/200450194 - class Alexa < BotMatch - ip_ranges %w[ - 52.86.176.3 - 52.4.48.181 - 52.2.182.169 - 52.86.185.29 - ] - end - - rule Legitbot::Alexa, %w[Alexabot ia_archiver] -end diff --git a/test/alexa_test.rb b/test/alexa_test.rb deleted file mode 100644 index 6d203b3..0000000 --- a/test/alexa_test.rb +++ /dev/null @@ -1,42 +0,0 @@ -# frozen_string_literal: true - -require_relative 'test_helper' - -class AlexaTest < Minitest::Test - include Minitest::Hooks - include DnsServerMock - - def test_malicious_ip - ip = '149.210.164.47' - match = Legitbot::Alexa.new ip - - refute_predicate match, :valid? - end - - def test_valid_ip - ip = '52.86.176.3' - match = Legitbot::Alexa.new ip - - assert_predicate match, :valid? - end - - def test_malicious_ua - bot = Legitbot.bot( - 'Mozilla/5.0 (compatible; Alexabot/1.0; +http://www.alexa.com/help/certifyscan; certifyscan@alexa.com)', - '149.210.164.47' - ) - - assert bot - refute_predicate bot, :valid? - end - - def test_valid_ua - bot = Legitbot.bot( - 'Mozilla/5.0 (compatible; Alexabot/1.0; +http://www.alexa.com/help/certifyscan; certifyscan@alexa.com)', - '52.86.176.3' - ) - - assert bot - assert_predicate bot, :valid? - end -end