| Server IP : 156.238.232.47 / Your IP : 216.73.216.150 Web Server : nginx/1.25.3 System : Linux C202504152095410 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : www ( 1000) PHP Version : 8.3.25 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /www/data/wwwroot/2026_07_07_01/apps/home/controller/ |
Upload File : |
<?php
/**
* @copyright (C)2016-2099 Hnaoyun Inc.
* @license This is not a freeware, use is subject to license terms
* @author XingMeng
* @email hnxsh@foxmail.com
* @date 2021年10月27日
*
*/
namespace app\home\controller;
use core\basic\Controller;
class SpiderController extends Controller
{
private $url;
public function __construct($url = null)
{
$this->url = $url ? escape_string($url) : get('url');
}
public function index()
{
forbWords(URL);
$rs = $this->getSpider();
if ($rs !== false) {
$this->log($rs . '爬行' . $this->url);
}
}
private function getSpider()
{
$useragent = strtolower($_SERVER['HTTP_USER_AGENT']);
if (strpos($useragent, 'googlebot') !== false) {
return 'Google';
} elseif (strpos($useragent, 'baiduspider') !== false) {
return 'Baidu';
} elseif (strpos($useragent, 'webscan') !== false) {
return '360WebScan';
} elseif (strpos($useragent, '360spider') !== false) {
return '360So';
} elseif (strpos($useragent, 'adsbot') !== false) {
return 'Adwords';
} elseif (strpos($useragent, 'bingbot') !== false) {
return 'Bing';
} elseif (strpos($useragent, 'slurp') !== false) {
return 'Yahoo';
} elseif (strpos($useragent, 'sosospider') !== false) {
return 'Soso';
} elseif (strpos($useragent, 'sogou') !== false) {
return 'Sogou';
} elseif (strpos($useragent, 'yodaobot') !== false) {
return 'Yodao';
} elseif (strpos($useragent, 'speedy') !== false) {
return 'Speedy';
} elseif (strpos($useragent, 'yandexbot') !== false) {
return 'Yandex';
} elseif (strpos($useragent, 'easouspider') !== false) {
return 'Easou';
} elseif (strpos($useragent, 'symantecspider') !== false) {
return 'Symantec';
} elseif (strpos($useragent, 'qiniu') !== false) {
return 'Qiniu';
} elseif (strpos($useragent, 'jiankongbao') !== false) {
return 'JianKongBao';
} elseif (strpos($useragent, 'dnspod') !== false) {
return 'DNSPod';
} elseif (strpos($useragent, 'linkpadbot') !== false) {
return 'Linkpad';
} elseif (strpos($useragent, 'mj12bot') !== false) {
return 'MJ12';
} elseif (strpos($useragent, 'dingtalkbot') !== false) {
return 'DingTalk';
} elseif (strpos($useragent, 'bytespider') !== false) {
return 'Byte';
} elseif (strpos($useragent, 'zoominfobot') !== false) {
return 'Zoominfo';
} elseif (strpos($useragent, 'yisouspider') !== false) {
return 'Yisou';
} elseif (strpos($useragent, 'spider') !== false) {
return 'other-spider';
} elseif (strpos($useragent, 'bot') !== false) {
return 'other-bot';
}
return false;
}
}