fix thiladhun
This commit is contained in:
@@ -18,22 +18,23 @@ class ThiladhunFeed implements Feed
|
||||
*/
|
||||
public function get() : array
|
||||
{
|
||||
|
||||
$crawler = $this->client->request('GET', "https://www.thiladhun.com");
|
||||
|
||||
$feeds = [];
|
||||
$crawler->filter('div[class*="posts-listing posts-list"] article')->each(function ($node) use (&$feeds) {
|
||||
|
||||
|
||||
$feeds[] = [
|
||||
"title" => $node->filter('.post__title a')->text(),
|
||||
"link" => $node->filter('.post__title a')->attr('href'),
|
||||
"date" => $node->filter('time')->first()->attr('datetime')
|
||||
];
|
||||
// Assuming 'ފަހުގެ' is a unique identifier for the section of interest
|
||||
$crawler->filter('.elementor-element:contains("ފަހުގެ")')->nextAll('.elementor-post')->each(function ($node) use (&$feeds) {
|
||||
$title = $node->filter('.elementor-heading-title a')->count() ? $node->filter('.elementor-heading-title a')->text() : null;
|
||||
$link = $node->filter('.elementor-heading-title a')->count() ? $node->filter('.elementor-heading-title a')->attr('href') : null;
|
||||
|
||||
if ($title && $link) {
|
||||
$feeds[] = [
|
||||
"title" => $title,
|
||||
"link" => $link,
|
||||
];
|
||||
}
|
||||
});
|
||||
|
||||
return $feeds;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user