Voice intergration

This commit is contained in:
2020-08-18 00:47:08 +05:00
parent 508f894530
commit e0f0e29bd4
4 changed files with 191 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Services\Feeds;
use Goutte\Client;
class VoiceFeed
{
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']);
}
}