Debug (serp parser)

This commit is contained in:
2023-09-25 10:10:34 +08:00
parent b2de1361aa
commit accb3eb94b
2 changed files with 6 additions and 6 deletions

View File

@@ -19,16 +19,16 @@ public static function handle(NewsSerpResult $news_serp_result, $serp_counts = 1
$success = false; $success = false;
// try { try {
$serp_results = OSSUploader::readJson( $serp_results = OSSUploader::readJson(
config('platform.dataset.news.news_serp.driver'), config('platform.dataset.news.news_serp.driver'),
config('platform.dataset.news.news_serp.path'), config('platform.dataset.news.news_serp.path'),
$news_serp_result->filename)?->tasks[0]?->result[0]?->items; $news_serp_result->filename)?->tasks[0]?->result[0]?->items;
// } catch (Exception $e) { } catch (Exception $e) {
// $serp_results = null; $serp_results = null;
// } }
if (! is_null($serp_results)) { if (! is_null($serp_results)) {
@@ -36,7 +36,7 @@ public static function handle(NewsSerpResult $news_serp_result, $serp_counts = 1
foreach ($serp_results as $serp_item) { foreach ($serp_results as $serp_item) {
dump($serp_item); //dump($serp_item);
$news_date = Carbon::parse($serp_item->timestamp); $news_date = Carbon::parse($serp_item->timestamp);

View File

@@ -29,7 +29,7 @@
}); });
Route::get('/news_serp_parse', function () { Route::get('/news_serp_parse', function () {
$news_serp_result = NewsSerpResult::find(2); $news_serp_result = NewsSerpResult::find(3);
$serp_urls = ParseNewsSerpDomainsTask::handle($news_serp_result); $serp_urls = ParseNewsSerpDomainsTask::handle($news_serp_result);
dd($serp_urls); dd($serp_urls);
}); });