Commit f3d2ffbd authored by clone's avatar clone

爬取数据

parent bea3988c
# Netscape HTTP Cookie File
# http://curl.haxx.se/docs/http-cookies.html
# https://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk.
a1.easemob.com FALSE / FALSE 1523278173 rememberMe deleteMe
.haozu.com TRUE / FALSE 1559618444 hzucsso deleted
.haozu.com TRUE / FALSE 1559640044 haozu_user %7B%22index%22%3A3%2C%22name%22%3A%22haozu%22%2C%22value%22%3A%22haozu%22%2C%22opt_scope%22%3A2%7D
.haozu.com TRUE / FALSE 1559791244 citydomain sh
......@@ -934,6 +934,7 @@ Route::group('broker', [
Route::group('search', [
'search' => ['search/Search/search', ['method' => 'get|post']],
'getHaoZu' => ['search/Reptile/getHaoZu', ['method' => 'get|post']],
]);
......
<?php
namespace app\search\controller;
use app\search\extend\Basic;
use app\search\service\ReptileService;
use think\Request;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/6/4
* Time: 11:08
*/
class Reptile extends Basic{
private $service_;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new ReptileService();
}
public function getHaoZu(){
$url = "https://cowork.haozu.com/sh/list/";
$result = $this->service_->getHaoZu($url);
return $this->response("200","success",$result);
}
}
\ No newline at end of file
<?php
namespace app\search\service;
use app\chat\utils\CurlUtil;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/6/4
* Time: 11:10
*/
class ReptileService
{
public function getHaoZu($url)
{
$curl = new CurlUtil();
$curl->headers = [
"Accept" => "application/json",
"Content-Type" => "application/json;charset=utf-8",
];
$curl->options = [
"CURLOPT_SSL_VERIFYPEER" => 0,
"CURLOPT_SSL_VERIFYHOST" => 2,
];
$response = $curl->post($url, []);
return $response;
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment