fix voice

This commit is contained in:
Mohamed jinas
2024-01-07 21:18:43 +05:00
parent 46ead16ef8
commit c8329962b7
4 changed files with 37 additions and 40 deletions

View File

@@ -9,8 +9,9 @@ class VoiceFeed implements Feed
public function __construct()
{
$this->client = new Client();
}
$this->client = new Client();
}
/**
* Get all the latest news
*
@@ -18,11 +19,14 @@ class VoiceFeed implements Feed
*/
public function get() : array
{
$crawler = $this->client->request('GET', "https://voice.mv/");
return $crawler->filter('div[id*="latest-news"] .content a')
->extract(['_text', '_attr' => 'href']);
return $crawler->filter('div#latest-news > div > a')->each(function ($node) {
return [
"title" => $node->filter('.dv-bold')->text(),
"link" => 'https://voice.mv' . $node->attr('href'),
"date" => $node->filter('.en-font')->text(),
];
});
}
}
}