Sha256: 4baea1ae880dba670ea0d0f799c982b4382696ffc658a2750f2df499328b6965

Contents?: true

Size: 506 Bytes

Versions: 6

Compression:

Stored size: 506 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, source: :radb
      results = client.perform

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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
legitbot-1.10.5 lib/legitbot/facebook.rb
legitbot-1.10.4 lib/legitbot/facebook.rb
legitbot-1.10.3 lib/legitbot/facebook.rb
legitbot-1.10.1 lib/legitbot/facebook.rb
legitbot-1.10.0 lib/legitbot/facebook.rb
legitbot-1.9.4 lib/legitbot/facebook.rb