No commit activity in last 3 years
No release in over 3 years
Detect and verify select (i.e. Google and Yandex) search bots.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

>= 0
 Project Readme

Search Bot Detector

Detect and verify select (i.e. Google and Yandex) search bots. Similar functionality is provided by the browser gem; this goes further in that we use DNS lookups to validate that a bot is actually what it says it is.

Supported Bots

  • Googlebot. Detected and verified as suggested here.
  • Yandex robot. Detected and verified as suggested here.

Installation

Simply add search-bot-detector to your Gemfile:

gem "search-bot-detector"

Usage

Super simple example:

require "search-bot-detector"

# IP address of `example.com` returns false.
SearchBotDetector.new("93.184.216.34", "Googlebot").any_bot?
# => false

# IP address of `crawl-66-249-66-1.googlebot.com` returns true.
SearchBotDetector.new("66.249.66.1", "Googlebot").any_bot?
# => true

# IP address of `spider-100-43-81-144.yandex.com` returns true.
SearchBotDetector.new("100.43.81.144", "+http://yandex.com/bots").any_bot?
# => true