From b1e1c270f8530f59884d510ff029d9f393205ee9 Mon Sep 17 00:00:00 2001 From: Alexander Azarov Date: Sat, 7 Dec 2024 08:19:31 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5=20remove=20`you.com`=20(#169)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #165 --- README.md | 1 - lib/legitbot.rb | 1 - lib/legitbot/you.rb | 13 ------------- test/you_test.rb | 39 --------------------------------------- 4 files changed, 54 deletions(-) delete mode 100644 lib/legitbot/you.rb delete mode 100644 test/you_test.rb diff --git a/README.md b/README.md index 7930304..08a2025 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,6 @@ end the list of IPs is in the [Troubleshooting page](https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/troubleshooting-cards) - [Yandex robots](https://yandex.com/support/webmaster/robot-workings/check-yandex-robots.xml) -- [You.com](https://about.you.com/youbot/) ## License diff --git a/lib/legitbot.rb b/lib/legitbot.rb index 28ce4da..a6f1d83 100644 --- a/lib/legitbot.rb +++ b/lib/legitbot.rb @@ -22,4 +22,3 @@ require_relative 'legitbot/pinterest' require_relative 'legitbot/twitter' require_relative 'legitbot/yandex' -require_relative 'legitbot/you' diff --git a/lib/legitbot/you.rb b/lib/legitbot/you.rb deleted file mode 100644 index 934d20c..0000000 --- a/lib/legitbot/you.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -module Legitbot # :nodoc: - # https://about.you.com/youbot/ - class You < BotMatch - ip_ranges %w[ - 20.59.40.22 - 52.226.199.170 - ] - end - - rule Legitbot::You, %w[YouBot/] -end diff --git a/test/you_test.rb b/test/you_test.rb deleted file mode 100644 index 0cbda42..0000000 --- a/test/you_test.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -require_relative 'test_helper' - -class YouTest < Minitest::Test - def test_malicious_ip - ip = '20.59.41.22' - match = Legitbot::You.new ip - - refute_predicate match, :valid? - end - - def test_valid_ip - ip = '20.59.40.22' - match = Legitbot::You.new ip - - assert_predicate match, :valid? - end - - def test_malicious_ua - bot = Legitbot.bot( - 'Mozilla/5.0 (compatible; YouBot/1.0; +https://about.you.com/youbot/)', - '20.59.41.22' - ) - - assert bot - refute_predicate bot, :valid? - end - - def test_valid_ua - bot = Legitbot.bot( - 'Mozilla/5.0 (compatible; YouBot/1.0; +https://about.you.com/youbot/)', - '20.59.40.22' - ) - - assert bot - assert_predicate bot, :valid? - end -end