테스트 사이트 - 개발 중인 베타 버전입니다

bot체크 어떻게 하면 할수있나여 채택완료

유유z 8년 전 조회 9,322

봇체크해서 적용할려는데

관련된 함수없을까여?

 

그리고 봇체크하면 구글에서 들어오는거 

다거를수있는건가여?

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트
8년 전

봇체크 함수입니다.

 

function get_brow($agent) {     $agent = strtolower($agent);

    //echo $agent; 

    if (preg_match("/msie 5.0[0-9]*/", $agent))                   { $s = "MSIE 5.0"; }     else if(preg_match("/msie 5.5[0-9]*/", $agent))               { $s = "MSIE 5.5"; }     else if(preg_match("/msie 6.0[0-9]*/", $agent))               { $s = "MSIE 6.0"; }     else if(preg_match("/msie 7.0[0-9]*/", $agent))               { $s = "MSIE 7.0"; }     else if(preg_match("/msie 8.0[0-9]*/", $agent))               { $s = "MSIE 8.0"; }     else if(preg_match("/msie 9.0[0-9]*/", $agent))               { $s = "MSIE 9.0"; }     else if(preg_match("/msie 10.0[0-9]*/", $agent))              { $s = "MSIE 10.0"; }     else if(preg_match("/msie 4.[0-9]*/", $agent))                { $s = "MSIE 4.x"; }     else if(preg_match("/firefox/", $agent))                      { $s = "FireFox"; }     else if(preg_match("/chrome/", $agent))                       { $s = "Chrome"; }     else if(preg_match("/x11/", $agent))                          { $s = "Netscape"; }     else if(preg_match("/opera/", $agent))                        { $s = "Opera"; }     else if(preg_match("/gec/", $agent))                          { $s = "Gecko"; }     else if(preg_match("/python/", $agent))                       { $s = "Python"; }     else if(preg_match("/bot|slurp|scrap|spider|crawl/", $agent)) { $s = "Robot"; }     else if(preg_match("/internet explorer/", $agent))            { $s = "IE"; }     else if(preg_match("/mozilla/", $agent))                      { $s = "Mozilla"; }     else { $s = "기타"; }

    return $s; }

function get_os($agent) {     $agent = strtolower($agent);

    //echo $agent; 

    if (preg_match("/windows 95/", $agent))                       { $s = " Win 95"; }     else if(preg_match("/iphone/", $agent))                       { $s = "iPhone"; } //iPhone     else if(preg_match("/ipad/", $agent))                         { $s = "iPad"; } //iPad     else if(preg_match("/iPod/", $agent))                         { $s = "iPod"; } //iPod     else if(preg_match("/android/", $agent))                      { $s = "Android"; } //Android     else if(preg_match("/psp/", $agent))                          { $s = "PSP"; } //PSP     else if(preg_match("/playstation/", $agent))                  { $s = "PLAYSTATION"; } //PLAYSTATION     else if(preg_match("/berry/", $agent))                        { $s = "BlackBerry"; } //BlackBerry     else if(preg_match("/symbian/", $agent))                      { $s = "Symbian"; } //Symbian     else if(preg_match("/ericsson/", $agent))                     { $s = "SonyEricsson"; } //SonyEricsson     else if(preg_match("/nokia/", $agent))                        { $s = "Nokia"; } //Nokia     else if(preg_match("/sph/", $agent))                          { $s = "애니콜"; } //삼성폰     else if(preg_match("/sgh/", $agent))                          { $s = "옴니아"; } //옴니아     else if(preg_match("/sch/", $agent))                          { $s = "T*옴니아"; } //T*옴니아     else if(preg_match("/im-s/", $agent))                         { $s = "스카이폰"; } //스카이폰     else if(preg_match("/lgtelecom/", $agent))                    { $s = "LG 사이언"; } //LG 사이언     /* Win OS */     else if(preg_match("/windows 98/", $agent))                   { $s = "Win 98"; }     else if(preg_match("/windows nt 4\.[0-9]*/", $agent))         { $s = "NT"; }     else if(preg_match("/windows nt 5\.0/", $agent))              { $s = "Win 2000"; }     else if(preg_match("/windows nt 5\.1/", $agent))              { $s = "Win XP"; }     else if(preg_match("/windows nt 5\.2/", $agent))              { $s = "Win 2003"; }     else if(preg_match("/windows nt 6\.0/", $agent))              { $s = "Win Vista"; }     else if(preg_match("/windows nt 6\.1/", $agent))              { $s = "Win 7"; }     else if(preg_match("/windows nt 6\.2/", $agent))              { $s = "Win 8"; }     else if(preg_match("/windows 9x/", $agent))                   { $s = "ME"; }     else if(preg_match("/windows ce/", $agent))                   { $s = "CE"; }     /* MAC OS X */     else if(preg_match("/mac os x 10.5/", $agent))                { $s = "Mac OS 10.5"; }     else if(preg_match("/mac os x 10_5_1/", $agent))              { $s = "Mac OS 10.5.1"; }     else if(preg_match("/mac os x 10_5_2/", $agent))              { $s = "Mac OS 10.5.2"; }     else if(preg_match("/mac os x 10_5_3/", $agent))              { $s = "Mac OS 10.5.3"; }     else if(preg_match("/mac os x 10_5_4/", $agent))              { $s = "Mac OS 10.5.4"; }     else if(preg_match("/mac os x 10_5_5/", $agent))              { $s = "Mac OS 10.5.5"; }     else if(preg_match("/mac os x 10_5_6/", $agent))              { $s = "Mac OS 10.5.6"; }     else if(preg_match("/mac os x 10_5_7/", $agent))              { $s = "Mac OS 10.5.7"; }      else if(preg_match("/mac os x 10_5_8/", $agent))              { $s = "Mac OS 10.5.8"; }      else if(preg_match("/mac os x 10.6/", $agent))                { $s = "Mac OS 10.6"; }     else if(preg_match("/mac os x 10_6_1/", $agent))              { $s = "Mac OS 10.6.1"; }     else if(preg_match("/mac os x 10_6_2/", $agent))              { $s = "Mac OS 10.6.2"; }     else if(preg_match("/mac os x 10_6_3/", $agent))              { $s = "Mac OS 10.6.3"; }     else if(preg_match("/mac os x 10_6_4/", $agent))              { $s = "Mac OS 10.6.4"; }     else if(preg_match("/mac os x 10_6_5/", $agent))              { $s = "Mac OS 10.6.5"; }     else if(preg_match("/mac os x 10_6_6/", $agent))              { $s = "Mac OS 10.6.6"; }     else if(preg_match("/mac os x 10_6_7/", $agent))              { $s = "Mac OS 10.6.7"; }     else if(preg_match("/mac os x 10_6_8/", $agent))              { $s = "Mac OS 10.6.8"; }     else if(preg_match("/mac os x 10_6_9/", $agent))              { $s = "Mac OS 10.6.9"; }     else if(preg_match("/mac os x 10.7/", $agent))                { $s = "Mac OS 10.7"; }     else if(preg_match("/mac os x 10_7_1/", $agent))              { $s = "Mac OS 10.7.1"; }     else if(preg_match("/mac os x 10_7_2/", $agent))              { $s = "Mac OS 10.7.2"; }     else if(preg_match("/mac os x 10_7_3/", $agent))              { $s = "Mac OS 10.7.3"; }     else if(preg_match("/mac os x 10_7_4/", $agent))              { $s = "Mac OS 10.7.4"; }     else if(preg_match("/mac os x 10.8/", $agent))                { $s = "Mac OS 10.8"; }

    else if(preg_match("/linux/", $agent))                        { $s = "Linux"; }     else if(preg_match("/sunos/", $agent))                        { $s = "sunOS"; }     else if(preg_match("/irix/", $agent))                         { $s = "IRIX"; }     else if(preg_match("/phone/", $agent))                        { $s = "Phone"; }     else if(preg_match("/internet explorer/", $agent))            { $s = "IE"; }     else if(preg_match("/phone|skt|lge|0450/", $agent))           { $s = "Mobile"; }     else if(preg_match("/yeti/", $agent))                         { $s = "NAVER Robot"; } //네이버 로봇     else if(preg_match("/mediapartners/", $agent))                { $s = "Google AdSense"; } //구글 애드센스     else if(preg_match("/google/", $agent))                       { $s = "Google Robot"; } //구글 로봇     else if(preg_match("/msn/", $agent))                          { $s = "Msn Robot"; } //MSN 로봇     else if(preg_match("/bing/", $agent))                         { $s = "Bing Robot"; } //Bing 로봇     else if(preg_match("/yahoo/", $agent))                        { $s = "Yahoo! Robot"; } //야후! 로봇     else if(preg_match("/daum/", $agent))                         { $s = "DAUM Robot"; } //다음 로봇     else if(preg_match("/empas/", $agent))                        { $s = "Empas Robot"; } //네이트 로봇     else if(preg_match("/zum/", $agent))                          { $s = "Zum Robot"; } //줌 로봇     else if(preg_match("/baidu/", $agent))                        { $s = "Baidu Robot"; } //바이두 로봇     else if(preg_match("/mj12/", $agent))                         { $s = "majestic12 Robot"; } //마제스틱12 로봇     else if(preg_match("/yandex/", $agent))                       { $s = "YandexBot Robot"; } //Yandex 로봇     else if(preg_match("/ahrefs/", $agent))                       { $s = "Ahrefs Robot"; } //Ahrefs 로봇     else if(preg_match("/rss/", $agent))                          { $s = "RSS Reader"; } //RSS리더     else if(preg_match("/bot|slurp|scrap|spider|crawl/", $agent)) { $s = "Robot"; } //기타 로봇     else { $s = "기타"; }

    return $s; } ?>

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

IZSOFT
8년 전

최상위 폴더에 robots.txt 만들어놓고 설정해놓으면 유명한 검색 봇들은 저규약 따릅니다.

 

http://www.dongpyo.com/blog/?p=1205">http://www.dongpyo.com/blog/?p=1205 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

P
8년 전
1. 이거 아니면

  1. /* Is Bot
  2. ------------------------------------------------------*/
  3. function is_bot(){
  4.  
  5. $bot_list= array("Ask Jeeves","Baiduspider","Butterfly","FAST","Feedfetcher-Google","Firefly","Gigabot","Googlebot","InfoSeek","Me.dium","Mediapartners-Google","NationalDirectory","Rankivabot","Scooter","Slurp","Sogou web spider","Spade","TECNOSEEK","TechnoratiSnoop","Teoma","TweetmemeBot","Twiceler","Twitturls","URL_Spider_SQL","WebAlta Crawler","WebBug","WebFindBot","ZyBorg","alexa","appie","crawler","froogle","girafabot","inktomi","looksmart","msnbot","rabaz","http://www.galaxy.com">www.galaxy.com");
  6. $user_agent= $_SERVER["HTTP_USER_AGENT"];
  7.  
  8.  
  9. foreach($bot_list as $bot){
  10.  
  11. if(strpos($user_agent,$bot)!== false){
  12.  
  13. return true;
  14.  
  15. }
  16.  
  17.  
  18. return false;
  19.  
  20. }
  21.  
  22. }

 

 


2. 이거 한번 보세요
function is_bot(){
	$botlist = array("Teoma", "alexa", "froogle", "Gigabot", "inktomi",
	"looksmart", "URL_Spider_SQL", "Firefly", "NationalDirectory",
	"Ask Jeeves", "TECNOSEEK", "InfoSeek", "WebFindBot", "girafabot",
	"crawler", "www.galaxy.com", "Googlebot", "Scooter", "Slurp",
	"msnbot", "appie", "FAST", "WebBug", "Spade", "ZyBorg", "rabaz",
	"Baiduspider", "Feedfetcher-Google", "TechnoratiSnoop", "Rankivabot",
	"Mediapartners-Google", "Sogou web spider", "WebAlta Crawler","TweetmemeBot",
	"Butterfly","Twitturls","Me.dium","Twiceler");
 
	foreach($botlist as $bot){
		if(strpos($_SERVER['HTTP_USER_AGENT'],$bot)!==false)
		return true;	// Is a bot
	}
 
	return false;	// Not a bot
}
로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인