fix thiladhun

This commit is contained in:
Mohamed jinas
2024-01-07 21:42:31 +05:00
parent c8329962b7
commit 0589b19843
3 changed files with 29 additions and 25 deletions
+2 -2
View File
@@ -20,12 +20,12 @@ class ThiladhunService extends Client
$response = Http::get("https://thiladhun.com/feed")->body();
$data = json_decode(json_encode(simplexml_load_string($response)), true);
$articles = $data["channel"]["item"];
$articlesitems = [];
//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(Str::before($article["link"], '?'), $article["pubDate"]);
$articlesitems[] = (new ThiladhunScraper)->extract($article["link"]);
}
return $articlesitems;