Voice intergration

This commit is contained in:
2020-08-18 00:47:08 +05:00
parent 508f894530
commit e0f0e29bd4
4 changed files with 191 additions and 0 deletions

View 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;
}
}