Sha256: 0a6cc596addfa370d1d2214a077d58a3ee920e05102a659ffea9b7455f9bb566

Contents?: true

Size: 361 Bytes

Versions: 3

Compression:

Stored size: 361 Bytes

Contents

module Legitbot
  # https://ahrefs.com/robot
  class Ahrefs < BotMatch
    Ranges = %w(54.36.148.0/24 54.36.149.0/24 54.36.150.0/24 195.154.122.0/24 195.154.123.0/24 195.154.126.0/24 195.154.127.0/24)

    def valid?
      ip = IPAddr.new @ip
      Ranges.any? { |range| IPAddr.new(range).include? ip }
    end
  end

  rule Legitbot::Ahrefs, %w(AhrefsBot)
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
legitbot-0.3.2 lib/legitbot/ahrefs.rb
legitbot-0.3.1 lib/legitbot/ahrefs.rb
legitbot-0.3.0 lib/legitbot/ahrefs.rb