|
@@ -4,6 +4,7 @@ |
|
@@ -4,6 +4,7 @@ |
|
4
|
namespace App\Helper;
|
4
|
namespace App\Helper;
|
|
5
|
|
5
|
|
|
6
|
use App\Utils\HttpUtils;
|
6
|
use App\Utils\HttpUtils;
|
|
|
|
7
|
+use GuzzleHttp\Client;
|
|
7
|
use GuzzleHttp\Exception\GuzzleException;
|
8
|
use GuzzleHttp\Exception\GuzzleException;
|
|
8
|
use Illuminate\Support\Facades\Cache;
|
9
|
use Illuminate\Support\Facades\Cache;
|
|
9
|
use Illuminate\Support\Facades\Log;
|
10
|
use Illuminate\Support\Facades\Log;
|
|
@@ -95,7 +96,13 @@ class QuanqiusouApi |
|
@@ -95,7 +96,13 @@ class QuanqiusouApi |
|
95
|
//8918_kr_2024-02-19_2024-02-25.json 8918_2024-02-19_2024-02-25.json
|
96
|
//8918_kr_2024-02-19_2024-02-25.json 8918_2024-02-19_2024-02-25.json
|
|
96
|
$api_url = "https://quanqiusou.cn/google-rank/data_json/{$today}/{$api_no}_{$startDay}_{$endDay}.json";
|
97
|
$api_url = "https://quanqiusou.cn/google-rank/data_json/{$today}/{$api_no}_{$startDay}_{$endDay}.json";
|
|
97
|
try {
|
98
|
try {
|
|
98
|
- $res = HttpUtils::get($api_url, []);
|
99
|
+ //$res = HttpUtils::get($api_url, []);
|
|
|
|
100
|
+ $client = new Client();
|
|
|
|
101
|
+ $response = $client->request('GET', $api_url, [
|
|
|
|
102
|
+ 'proxy' => '64.34.204.224:51395', // 代理服务器地址和端口号
|
|
|
|
103
|
+ // 其他请求选项
|
|
|
|
104
|
+ ]);
|
|
|
|
105
|
+ $res = $response->getBody()->getContents();
|
|
99
|
if($res){
|
106
|
if($res){
|
|
100
|
$res = Arr::s2a($res);
|
107
|
$res = Arr::s2a($res);
|
|
101
|
Cache::put($key, $res, 2 * 3600);
|
108
|
Cache::put($key, $res, 2 * 3600);
|