Voice intergration
This commit is contained in:
26
app/Services/VoiceService.php
Normal file
26
app/Services/VoiceService.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?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("https://voice.mv/".$article[1]);
|
||||
}
|
||||
|
||||
return $articlesitems;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user