HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: 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
Upload Files
File: /www/wwwroot/bs.kntsleep.com/system/admin/statistics/employ.class.php
<?php
/*
 * Copyright (c) Huyin Information Technology Co., Ltd. All Rights Reserved.
 * BOSSCMS Content Management System (https://www.bosscms.net/)
 */
defined('IS_OK') or exit('Access Forbidden');

into::basic_class('admin');

class employ extends admin
{
	public function init()
	{
		global $G;
		$G['cover'] = $this->cover();
		echo $this->theme('statistics/employ');
	}
	
	public function record()
	{
		global $G;
		$host = urlencode(arrExist(parse_url($G['config']['domain']),'host'));
		$file = ROOT_PATH.'cache/employ/'.md5($G['get']['platform'].$host);
		switch($G['get']['platform']){
			case 'baidu':
				$url = 'https://www.baidu.com/s?ie=utf-8&wd=site%3A'.$host;
				if(is_file($file) && filemtime($file)<TIME+3600){
					$mat[1] = file_get_contents($file);
				}else{
					$res = $this->curl($url);
					preg_match('/找到相关结果数约(.+)个/',$res,$mat);
					dir::create($file,$mat[1]);
				}
				break;
			case '360':
				$url = 'https://www.so.com/s?ie=utf-8&q=site%3A'.$host;
				if(is_file($file) && filemtime($file)<TIME+3600){
					$mat[1] = file_get_contents($file);
				}else{
					$res = $this->curl($url);
					preg_match('/该网站约(.+)个网页被360搜索收录/',$res,$mat);
					dir::create($file,$mat[1]);
				}
				break;
			case 'sogou':
				$url = 'https://www.sogou.com/web?query=site%3A'.$host;
				if(is_file($file) && filemtime($file)<TIME+3600){
					$mat[1] = file_get_contents($file);
				}else{
					$res = $this->curl($url);
					preg_match('/找到约(.+)条结果/',$res,$mat);
					dir::create($file,$mat[1]);
				}
				break;
			case 'bing':
				$url = 'https://cn.bing.com/search?q=site%3A'.$host;
				if(is_file($file) && filemtime($file)<TIME+3600){
					$mat[1] = file_get_contents($file);
				}else{
					$res = $this->curl($url);
					preg_match('/约(.+)个结果/',$res,$mat);
					dir::create($file,$mat[1]);
				}
				break;
		}
		echo '<b>'.setDefault($mat[1],0).'</b><a href="'.$url.'" target="_blank">手动查询</a>';
	}
	
	public function curl($url)
	{
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.5060.114 Safari/537.36 Edg/103.0.1264.49");
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$res = curl_exec($ch);
		curl_close($ch);
		return $res;
	}
}
?>