🎉 Hello world
This commit is contained in:
34
app/Parser/SeLoger.php
Normal file
34
app/Parser/SeLoger.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user