Thiladhun switch to virtual feed
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Services\Feeds\ThiladhunFeed;
|
||||
use App\Services\Scrapers\ThiladhunScraper;
|
||||
|
||||
class ThiladhunService extends Client
|
||||
@@ -14,13 +15,12 @@ class ThiladhunService extends Client
|
||||
public function scrape(): array
|
||||
{
|
||||
//Return only the rss that contains "news" keyboard in its url
|
||||
$articles = $this->get("https://thiladhun.com/feed")["channel"]["item"];
|
||||
$articles = (new ThiladhunFeed)->get();
|
||||
|
||||
$articlesitems = [];
|
||||
//Looping through the articles and scraping and while scraping it creates a new instance of the scraper.
|
||||
foreach ($articles as $article) {
|
||||
$link = $article['link'];
|
||||
$articlesitems[] = (new ThiladhunScraper)->extract($link);
|
||||
$articlesitems[] = (new ThiladhunScraper)->extract($article["link"], $article["date"]);
|
||||
}
|
||||
|
||||
return $articlesitems;
|
||||
|
||||
Reference in New Issue
Block a user