fix dhiyares
This commit is contained in:
@@ -14,15 +14,16 @@ class DhiyaresService extends Client
|
||||
*/
|
||||
public function scrape(): array
|
||||
{
|
||||
//Return only the rss that contains "news" keyboard in its url
|
||||
$articles = (new DhiyaresFeed)->get();
|
||||
|
||||
$articlesitems = [];
|
||||
//Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
|
||||
|
||||
$articleItems = [];
|
||||
foreach ($articles as $article) {
|
||||
$articlesitems[] = (new DhiyaresScraper)->extract($article["link"], $article["date"]);
|
||||
$scrapedData = (new DhiyaresScraper)->extract($article["link"], $article["date"]);
|
||||
if ($scrapedData !== null) {
|
||||
$articlesitems[] = $scrapedData;
|
||||
}
|
||||
}
|
||||
|
||||
return $articlesitems;
|
||||
return $articleItems;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user