A Ruby gem that detects bots, spiders, and crawlers by analyzing user agent strings.
Voight-Kampff is a Ruby gem that detects bots, spiders, and crawlers by analyzing HTTP request user agent strings. It solves the problem of distinguishing human traffic from automated requests, which is crucial for accurate analytics and preventing resource waste on non-human interactions. The gem provides simple methods to check if a request comes from a bot or a human.
Ruby and Rails developers who need to filter bot traffic from their web applications, such as those implementing analytics, hit tracking, or access control based on user type.
Developers choose Voight-Kampff for its lightweight, framework-agnostic design, easy integration with Rails and Rack, and reliance on an open, updatable list of bot user agents, ensuring accurate and maintainable detection without external dependencies.
Voight-Kampff is a Ruby gem that detects bots, spiders, crawlers and replicants
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Extends Rack::Request, so in Rails controllers, methods like request.bot? and request.human? work out of the box with minimal setup, as shown in the Gemfile require for 'voight_kampff/rails'.
Relies on an open-source JSON list from github.com/monperrus/crawler-user-agents, with a rake task to import updates, allowing developers to keep detection current without modifying the gem.
Supports both Rails and pure Rack through different require paths, making it versatile for various Ruby web projects, as detailed in the installation section.
Provides straightforward methods like VoightKampff.bot?(user_agent) and VoightKampff::Test instances, returning true/false with no external dependencies, ensuring easy adoption.
Detection is limited to user agent string matching, which is easily spoofed and may miss bots that mimic human agents, reducing effectiveness in adversarial scenarios.
Version 1.0 removed methods like #crawler? and #spam?, as noted in the upgrade notes, losing detailed bot categorization and forcing reliance on broader #bot? checks.
Accuracy hinges on a third-party list that may lag in updates; the README admits reliance on monperrus' project, and false positives/negatives can occur if patterns are outdated.