|
...
|
...
|
@@ -155,7 +155,6 @@ class WebTraffic extends Command |
|
|
|
//随机引流间隔
|
|
|
|
$res_sjjg = $this->get_rand($this->sjjg);
|
|
|
|
if ($res_sjjg == 1) {
|
|
|
|
echo '跳过';
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -189,33 +188,9 @@ class WebTraffic extends Command |
|
|
|
'url' => $project['visit_urls'][$j],
|
|
|
|
'device_port' => $this->get_rand($this->yddzb)
|
|
|
|
];
|
|
|
|
$query = [
|
|
|
|
'action' => 'stats_init',
|
|
|
|
'assort' => 0,
|
|
|
|
'referrer' => $data['referer'],
|
|
|
|
'currweb' => $data['url'],
|
|
|
|
'firstshow' => 0,
|
|
|
|
'screenwidth' => 1920,
|
|
|
|
'screenheight' => 1080,
|
|
|
|
'screencolordepth' => 24,
|
|
|
|
'ranstr' => 0.7088574053447112,
|
|
|
|
];
|
|
|
|
$header = [
|
|
|
|
'CLIENT-IP' => $data['ip'],
|
|
|
|
'X-FORWARDED-FOR' => $data['ip'],
|
|
|
|
'Referer' => $data['referer'],
|
|
|
|
'User-Agent' => $project['user_agent']
|
|
|
|
];
|
|
|
|
$promises[] = $client->getAsync($project['domain'] . 'wp-admin/admin-ajax.php', ['headers' => $header, 'query' => $query]);
|
|
|
|
// $promises[] = $client->postAsync($project['domain'] . 'api/customerVisit', ['form_params' => $data]);
|
|
|
|
}
|
|
|
|
$results = Utils::settle($promises)->wait();
|
|
|
|
|
|
|
|
foreach ($results as $key => $result) {
|
|
|
|
if ($result['state'] != 'fulfilled') {
|
|
|
|
dump($result);
|
|
|
|
}
|
|
|
|
$promises[] = $client->postAsync($project['domain'] . 'api/customerVisit', ['form_params' => $data]);
|
|
|
|
}
|
|
|
|
Utils::settle($promises)->wait();
|
|
|
|
|
|
|
|
//每个深度随机等待
|
|
|
|
sleep(rand(2, 10));
|
|
...
|
...
|
@@ -228,13 +203,13 @@ class WebTraffic extends Command |
|
|
|
* 不同项目 休眠
|
|
|
|
*/
|
|
|
|
protected function sleep($type){
|
|
|
|
// if($type == 1){ //1-3个月的项目
|
|
|
|
// sleep(rand(5,480));
|
|
|
|
// }elseif($type == 2){ //4-8个月的项目
|
|
|
|
// sleep(rand(5,240));
|
|
|
|
// }elseif($type == 3){ // 大于9个月的项目
|
|
|
|
// sleep(rand(5,120));
|
|
|
|
// }
|
|
|
|
if($type == 1){ //1-3个月的项目
|
|
|
|
sleep(rand(5,480));
|
|
|
|
}elseif($type == 2){ //4-8个月的项目
|
|
|
|
sleep(rand(5,240));
|
|
|
|
}elseif($type == 3){ // 大于9个月的项目
|
|
|
|
sleep(rand(5,120));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
...
|
...
|
|