我需要简单地检测访问者是机器人还是真正的浏览器。我有以下代码:
<cfset REQUEST.UserAgent = LCase( CGI.http_user_agent ) />
<cfif REFind( "bot\b", REQUEST.UserAgent ) OR
Find( "crawler", REQUEST.UserAgent ) OR
Find( "spider", REQUEST.UserAgent ) OR
Find( "slurp", REQUEST.UserAgent ) OR
Find( "mediapartners-google", REQUEST.UserAgent )>
<cfset notarobot = 0>
<cfelse>
<cfset notarobot = 1>
</cfif>
这会检测到常见的机器人,如MJ12bot,bingbot,slurp,googlebot,yandexbot,baiduspider等?提前谢谢。