Files
karudhaas/app/Services/VoiceService.php
Mohamed jinas c8329962b7 fix voice
2024-01-07 21:18:43 +05:00

29 lines
615 B
PHP

<?php
namespace App\Services;
use App\Services\Feeds\VoiceFeed;
use App\Services\Scrapers\VoiceScraper;
class VoiceService
{
/**
* Scrap all the rss articles from Sun
*
* @return array
*/
public function scrape(): array
{
$articles = (new VoiceFeed)->get();
$articlesitems = [];
//Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
foreach ($articles as $article) {
$articlesitems[] = (new VoiceScraper)->extract($article["link"]);
}
return $articlesitems;
}
}