discourse/lib/crawler_detection.rb

6 lines
127 B
Ruby

module CrawlerDetection
def self.crawler?(user_agent)
!/Googlebot|Mediapartners|AdsBot/.match(user_agent).nil?
end
end