Ignore gallery fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Services\Feeds\OneOnlineFeed;
|
use App\Services\Feeds\OneOnlineFeed;
|
||||||
@@ -18,9 +19,12 @@ class OneOnlineService
|
|||||||
$articlesitems = [];
|
$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) {
|
foreach ($articles as $article) {
|
||||||
$articlesitems[] = (new OneOnlineScraper)->extract($article["link"]);
|
$scraped_article = (new OneOnlineScraper)->extract($article["link"]);
|
||||||
|
if (!is_null($scraped_article)) {
|
||||||
|
$articlesitems[] = $scraped_article;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $articlesitems;
|
return $articlesitems;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,7 +26,7 @@ class OneOnlineScraper
|
|||||||
|
|
||||||
if($crawler->filter('.gallery-cover')->count() > 0)
|
if($crawler->filter('.gallery-cover')->count() > 0)
|
||||||
{
|
{
|
||||||
return 0;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$crawler->filter('h1')->each(function ($node) {
|
$crawler->filter('h1')->each(function ($node) {
|
||||||
|
Reference in New Issue
Block a user