Add (rss post): domain

This commit is contained in:
2023-11-23 21:30:33 +08:00
parent e4eb51b2b7
commit 0a1987f593
4 changed files with 47 additions and 0 deletions

View File

@@ -53,6 +53,23 @@
Route::get('/crawlTask', [App\Http\Controllers\Tests\TestController::class, 'crawlTask']);
Route::get('/set_domain', function (Request $request) {
$last_record = RssPost::whereNull('post_domain')->orderBy('id', 'DESC')->first();
for ($i = 1; $i <= $last_record->id; $i++) {
$rss_post = RssPost::find($i);
if (!is_null($rss_post))
{
$rss_post->post_domain = get_domain_from_url($rss_post->post_url);
$rss_post->save();
}
}
return 'ok';
});
Route::get('/set_keywords', function (Request $request) {
$last_record = RssPost::where('keyword_saved', false)->orderBy('id', 'DESC')->first();