Initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace Admin\Controller;
|
||||
use Think\Controller;
|
||||
class ToolController extends AdminController{
|
||||
public function GetWxCrawler(){
|
||||
$url=I("post.url");
|
||||
$crawler=D("WxCrawler");
|
||||
$content = $crawler->crawByUrl($url);
|
||||
if($content[content_html]){
|
||||
$content[date]=date("Y-m-d H:i:s",$content[date]);
|
||||
//远程图片保存
|
||||
$SaveRemoteImg=new \Admin\Model\SaveRemoteImgModel();
|
||||
$matches[1]=$content[cover];
|
||||
$_POST["pubid"]=I("pubid");//要加入信息的pubid
|
||||
$content[cover]=$SaveRemoteImg->saveRemoteImg($matches);
|
||||
//
|
||||
$this->success($content);
|
||||
}else{
|
||||
$this->error("抓取失败!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user