<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Services\NewXiuGirlsService;
|
|
use App\Services\XiuGirlsService;
|
|
use Illuminate\Console\Command;
|
|
|
|
class XiuGirlScrape extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'xiu:get';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Command description';
|
|
|
|
/**
|
|
* Create a new command instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*
|
|
* @return mixed
|
|
*/
|
|
public function handle()
|
|
{
|
|
//
|
|
// $curl = curl_init();
|
|
|
|
// curl_setopt_array($curl, array(
|
|
// CURLOPT_URL => 'https://img.xsnvshen.com/album/22162/35724/000.jpg',
|
|
// CURLOPT_RETURNTRANSFER => true,
|
|
// CURLOPT_ENCODING => '',
|
|
// CURLOPT_MAXREDIRS => 10,
|
|
// CURLOPT_TIMEOUT => 0,
|
|
// CURLOPT_FOLLOWLOCATION => true,
|
|
// CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
|
// CURLOPT_CUSTOMREQUEST => 'GET',
|
|
// CURLOPT_HTTPHEADER => array(
|
|
// 'authority: img.xsnvshen.com',
|
|
// 'pragma: no-cache',
|
|
// 'cache-control: no-cache',
|
|
// 'sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="90", "Google Chrome";v="90"',
|
|
// 'sec-ch-ua-mobile: ?0',
|
|
// 'upgrade-insecure-requests: 1',
|
|
// 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.212 Safari/537.36',
|
|
// 'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
|
|
// 'sec-fetch-site: same-site',
|
|
// 'sec-fetch-mode: navigate',
|
|
// 'sec-fetch-user: ?1',
|
|
// 'sec-fetch-dest: document',
|
|
// 'referer: https://www.xsnvshen.com/album/35724/',
|
|
// 'accept-language: zh-CN,zh;q=0.9',
|
|
//// 'cookie: __cfduid=dac5872f65e79a40a5b30229ba97beb6a1619333692'
|
|
// ),
|
|
// ));
|
|
//
|
|
// $response = curl_exec($curl);
|
|
// file_put_contents("/Users/shixuesen/workspace/dev/src/graph-tutorial/0000000112.jpg", $response);
|
|
// exit;
|
|
$xiu1 = new NewXiuGirlsService();
|
|
$xiu1->scrapeXiuGirls();exit;
|
|
$xiu = new XiuGirlsService();
|
|
$xiu->scrapeXiuGirls();
|
|
}
|
|
}
|