2014-02-20 15:07:02 -06:00
module CrawlerDetection
2015-01-06 03:05:45 -06: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
2015-05-02 05:18:58 -05:00
# added 'Swiftbot' based on https://meta.discourse.org/t/how-to-add-html-markup-or-meta-tags-for-external-search-engine/28220
2015-02-14 08:24:51 -06:00
2014-02-20 15:07:02 -06:00
def self . crawler? ( user_agent )
2016-07-26 12:21:13 -05:00
! / Googlebot|Mediapartners|AdsBot|curl|Twitterbot|facebookexternalhit|bingbot|Baiduspider|ia_archiver|Wayback Save Page|360Spider|Swiftbot|YandexBot / . match ( user_agent ) . nil?
2014-02-14 16:10:08 -06:00
end
end