You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
887 B

<?php
namespace App\Parser;
use App\ParsedHome;
use App\Parser;
class SeLoger extends Parser
{
protected $params = [
'idtt' => 1,
'idtypebien' => '1,2',
'getDtCreationMax' => 1,
];
/**
* @inheritDoc
*/
public function parse(): ParsedHome
{
$idAnnonce = $this->getIdAnnonceFromUrl($this->url);
var_dump($idAnnonce);
$payload = $this->params + ['noAudiotel' => 1, 'idAnnonce' => $idAnnonce];
$request = $this->client->request('GET', "http://ws.seloger.com/annonceDetail_4.0.xml", $payload);
var_dump($request);
exit;
}
private function getIdAnnonceFromUrl($url)
{
// ex : https://www.seloger.com/annonces/achat/maison/franconville-95/vieux-marche-mare-des-noues/159100953.htm
return collect(explode('.', collect(explode('/', $url))->last()))->first();
}
}