This commit is contained in:
2020-10-06 01:11:23 +05:00
parent 608522f148
commit 32888bd5b2
3 changed files with 11 additions and 4 deletions

View File

@@ -18,7 +18,10 @@ class AvasService
$articlesitems = [];
//Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
foreach ($articles as $article) {
$articlesitems[] = (new AvasScraper)->extract($article["link"], $article["date"]);
$scraped_article = (new AvasScraper)->extract($article["link"], $article["date"]);
if (!is_null($scraped_article)) {
$articlesitems[] = $scraped_article;
}
}
return $articlesitems;