Sha256: e51dadd3e4d1cacf1e9b67191d6e9cd911ecf70d26666c7b814cae503968739a

Contents?: true

Size: 351 Bytes

Versions: 10

Compression:

Stored size: 351 Bytes

Contents

require 'ipaddr'

module Legitbot
  # https://support.apple.com/en-us/HT204683

  class Apple < BotMatch
    Range = IPAddr.new('17.0.0.0/8')

    def valid?
      ip = IPAddr.new @ip
      Range.include? ip
    end
  end

  class Apple_as_Google < Apple
  end

  rule Legitbot::Apple, %w(Applebot)
  rule Legitbot::Apple_as_Google, %w(Googlebot)
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
legitbot-0.3.2 lib/legitbot/apple.rb
legitbot-0.3.1 lib/legitbot/apple.rb
legitbot-0.3.0 lib/legitbot/apple.rb
legitbot-0.2.7 lib/legitbot/apple.rb
legitbot-0.2.6 lib/legitbot/apple.rb
legitbot-0.2.4 lib/legitbot/apple.rb
legitbot-0.2.3 lib/legitbot/apple.rb
legitbot-0.2.2 lib/legitbot/apple.rb
legitbot-0.2.1 lib/legitbot/apple.rb
legitbot-0.2.0 lib/legitbot/apple.rb