This commit is contained in:
2021-06-10 00:40:01 +05:00
parent 720d5d5fce
commit 7086227a98
2 changed files with 4 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Services;
use App\Services\Feeds\ThiladhunFeed;
use App\Services\Scrapers\ThiladhunScraper;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
class ThiladhunService extends Client
{
@@ -23,7 +24,8 @@ class ThiladhunService extends Client
$articlesitems = [];
//Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
foreach ($articles as $article) {
$articlesitems[] = (new ThiladhunScraper)->extract($article["link"], $article["pubDate"]);
//Remove query strings
$articlesitems[] = (new ThiladhunScraper)->extract(Str::before($article["link"], '?'), $article["pubDate"]);
}
return $articlesitems;