From 4cd016a041319404226108e6235ad1b9445fd752 Mon Sep 17 00:00:00 2001 From: xiaoz Date: Wed, 7 Nov 2018 21:29:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions/class/class.user.php | 9 +++++++++ functions/unknown.php | 35 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 functions/unknown.php diff --git a/functions/class/class.user.php b/functions/class/class.user.php index 45db975..dee422f 100644 --- a/functions/class/class.user.php +++ b/functions/class/class.user.php @@ -173,6 +173,15 @@ curl_close($curl); //var_dump($html); } + //查询未识别图片 + function unknown(){ + $thedate = date('Y-m-d',time()); + $sql = "SELECT * FROM `imginfo` WHERE (level IS NULL OR level = 0) AND date = '$thedate'"; + $database = $this->database; + //$datas = $database->select("imginfo","*"); + $datas = $database->query($sql)->fetchAll(); + return $datas; + } } //自动初始化完成一些基础操作 diff --git a/functions/unknown.php b/functions/unknown.php new file mode 100644 index 0000000..ef9b17d --- /dev/null +++ b/functions/unknown.php @@ -0,0 +1,35 @@ +unknown(); + + //遍历数据 + foreach( $datas as $key => $value ) + { + $url = $config['domain'].'dispose.php?id=' + $value['id']; + + //请求鉴黄接口 + $curl = curl_init($url); + + curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"); + curl_setopt($curl, CURLOPT_FAILONERROR, true); + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + #设置超时时间,最小为1s(可选) + curl_setopt($curl , CURLOPT_TIMEOUT, 3); + + $html = curl_exec($curl); + curl_close($curl); + } + echo '处理完成!'; +?> \ No newline at end of file