module Aua::Agents::SearchBot
Constants
- PATTERN_BAIDU
- PATTERN_BING
- PATTERN_GOOGLE
Public Class Methods
extend?(agent)
click to toggle source
# File lib/aua/agents/search_bot.rb, line 6 def self.extend?(agent) agent.raw =~ PATTERN_BING || agent.app_comments[1] == "Yahoo! Slurp" || agent.raw =~ PATTERN_BAIDU || agent.raw =~ PATTERN_GOOGLE || agent.app == "msnbot" || agent.app == "FLUX-Toolchain" end
Public Instance Methods
name()
click to toggle source
# File lib/aua/agents/search_bot.rb, line 19 def name @name ||= begin return :Bingbot if raw =~ PATTERN_BING return :YahooSlurp if app_comments[1] == "Yahoo! Slurp" return :Baiduspider if raw =~ PATTERN_BAIDU return $1 ? :GooglebotMobile : :Googlebot if raw =~ PATTERN_GOOGLE return :DWDSCrawler if app == "FLUX-Toolchain" app.to_sym end end
type()
click to toggle source
# File lib/aua/agents/search_bot.rb, line 15 def type :SearchBot end
version()
click to toggle source
Calls superclass method
# File lib/aua/agents/search_bot.rb, line 30 def version @version ||= begin return $1 if raw =~ PATTERN_BING return $1 if raw =~ PATTERN_BAIDU return $2 if raw =~ PATTERN_GOOGLE super end end