28 lines
564 B
PHP
28 lines
564 B
PHP
<?php
|
|
namespace App\Services\Feeds;
|
|
|
|
use Goutte\Client;
|
|
|
|
class VoiceFeed implements Feed
|
|
{
|
|
protected $client;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->client = new Client();
|
|
}
|
|
/**
|
|
* Get all the latest news
|
|
*
|
|
* @return array
|
|
*/
|
|
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']);
|
|
|
|
}
|
|
} |