2014-02-20 16:07:02 -05:00
|
|
|
module CrawlerDetection
|
2015-01-06 04:05:45 -05:00
|
|
|
# added 'ia_archiver' based on https://meta.discourse.org/t/unable-to-archive-discourse-pages-with-the-internet-archive/21232
|
|
|
|
# added 'Wayback Save Page' based on https://meta.discourse.org/t/unable-to-archive-discourse-with-the-internet-archive-save-page-now-button/22875
|
2014-02-20 16:07:02 -05:00
|
|
|
def self.crawler?(user_agent)
|
2015-01-06 04:05:45 -05:00
|
|
|
!/Googlebot|Mediapartners|AdsBot|curl|Twitterbot|facebookexternalhit|bingbot|Baiduspider|ia_archiver|Wayback Save Page/.match(user_agent).nil?
|
2014-02-14 17:10:08 -05:00
|
|
|
end
|
|
|
|
end
|