Sha256: 80ac51303b9ef8d5b8b14d8e5a43c8e6daee231efa81e27a445fec65011a2c53

Contents?: true

Size: 467 Bytes

Versions: 15

Compression:

Stored size: 467 Bytes

Contents

# frozen_string_literal: true

require 'irrc'

module Legitbot # :nodoc:
  # https://developers.facebook.com/docs/sharing/webmasters/crawler
  class Facebook < BotMatch
    AS = 'AS32934'

    ip_ranges do
      client = Irrc::Client.new
      client.query :radb, AS
      results = client.perform

      %i[ipv4 ipv6].map do |family|
        results[AS][family][AS]
      end.flatten
    end
  end

  rule Legitbot::Facebook, %w[Facebot facebookexternalhit/1.1]
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
legitbot-1.4.3 lib/legitbot/facebook.rb
legitbot-1.4.2 lib/legitbot/facebook.rb
legitbot-1.4.1 lib/legitbot/facebook.rb
legitbot-1.4.0 lib/legitbot/facebook.rb
legitbot-1.3.0 lib/legitbot/facebook.rb
legitbot-1.2.0 lib/legitbot/facebook.rb
legitbot-1.1.1 lib/legitbot/facebook.rb
legitbot-1.1.0 lib/legitbot/facebook.rb
legitbot-1.0.2 lib/legitbot/facebook.rb
legitbot-1.0.1 lib/legitbot/facebook.rb
legitbot-1.0.0 lib/legitbot/facebook.rb
legitbot-0.4.3 lib/legitbot/facebook.rb
legitbot-0.4.2 lib/legitbot/facebook.rb
legitbot-0.4.1 lib/legitbot/facebook.rb
legitbot-0.4.0 lib/legitbot/facebook.rb