WIP
This commit is contained in:
@@ -19,10 +19,15 @@ class ThiladhunService extends Client
|
||||
$articles = (new ThiladhunFeed)->get();
|
||||
|
||||
$articlesitems = [];
|
||||
//Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
|
||||
// Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
|
||||
foreach ($articles as $article) {
|
||||
//Remove query strings
|
||||
$articlesitems[] = (new ThiladhunScraper)->extract($article["link"]);
|
||||
// Scrape the article
|
||||
$scrapedArticle = (new ThiladhunScraper)->extract($article["link"]);
|
||||
|
||||
// Check if the scraped article is not null
|
||||
if ($scrapedArticle !== null && !empty($scrapedArticle)) {
|
||||
$articlesitems[] = $scrapedArticle;
|
||||
}
|
||||
}
|
||||
|
||||
return $articlesitems;
|
||||
|
||||
Reference in New Issue
Block a user