diff --git a/app/Http/Controllers/Api/ApiController.php b/app/Http/Controllers/Api/ApiController.php index 1a493fb..9340fc4 100644 --- a/app/Http/Controllers/Api/ApiController.php +++ b/app/Http/Controllers/Api/ApiController.php @@ -285,34 +285,4 @@ class ApiController extends Controller 'data' => $dataScrapping, ]); } - - public function testScrapping() - { - $client = new Client(); - - - $url = "https://ww1.anoboy.app/2016/10/one-piece-indonesia"; - - $response = Http::timeout(300)->withoutVerifying()->get($url); - $html = $response->body(); - - $crawler = new Crawler($html); - $table = $crawler->filter('table')->first(); - - $episodes = []; - $crawler->filter('ul#lcp_instance_0 li a')->each(function ($node) use (&$episodes) { - $title = $node->text(); - $url = $node->attr('href'); - - // Hanya ambil link yang berkaitan dengan One Piece - // if (stripos($title, 'One Piece') !== false) { - $episodes[] = [ - 'title' => $title, - 'url' => $url, - ]; - // } - }); - - return response()->json($episodes); - } } diff --git a/routes/api.php b/routes/api.php index d9a45c9..cf94619 100644 --- a/routes/api.php +++ b/routes/api.php @@ -26,7 +26,4 @@ Route::get('getKecamatan',[ApiController::class,'getKecamatan']); Route::get('getSekolah',[ApiController::class,'getSekolah']); Route::get('/scrappingMI', [ApiController::class, 'scrappingMI']); Route::get('/scrappingMA', [ApiController::class, 'scrappingMA']); - -Route::get('/testScrapping', [ApiController::class, 'testScrapping']); - // Route::get('getKabupaten',[ApiController::class,'getKabupaten']); \ No newline at end of file