[AutoJMBridge] Fix the bridge to follow website changes (#1255)

The Website changed in two way :
- The filter about availability disappeared (and this leads to a
  parameters change, which will break existing bridges, sorry)
- Some HTML change
This commit is contained in:
sysadminstory 2019-09-06 10:52:58 +02:00 committed by Lyra
parent 0dfc4ea2c5
commit cfe433e9e2
1 changed files with 1 additions and 12 deletions

View File

@ -15,16 +15,6 @@ class AutoJMBridge extends BridgeAbstract {
'title' => 'URL d\'une recherche avec filtre de véhicules sans le http://www.autojm.fr/', 'title' => 'URL d\'une recherche avec filtre de véhicules sans le http://www.autojm.fr/',
'exampleValue' => 'achat-voitures-neuves-peugeot-nouvelle-308-5p' 'exampleValue' => 'achat-voitures-neuves-peugeot-nouvelle-308-5p'
), ),
'isDispo' => array(
'name' => 'Disponibilité',
'type' => 'list',
'values' => array(
'-' => '',
'En stock' => 1,
'Sur commande' => 0
),
'title' => 'Critère de disponibilité'
),
'energy' => array( 'energy' => array(
'name' => 'Carburant', 'name' => 'Carburant',
'type' => 'list', 'type' => 'list',
@ -92,7 +82,6 @@ class AutoJMBridge extends BridgeAbstract {
// Build the form // Build the form
$post_data = array( $post_data = array(
'form[isDispo]' => $this->getInput('isDispo'),
'form[energy]' => $this->getInput('energy'), 'form[energy]' => $this->getInput('energy'),
'form[transmission]' => $this->getInput('transmission'), 'form[transmission]' => $this->getInput('transmission'),
'form[priceMin]' => $this->getInput('priceMin'), 'form[priceMin]' => $this->getInput('priceMin'),
@ -121,7 +110,7 @@ class AutoJMBridge extends BridgeAbstract {
$html = str_get_html($data->content); $html = str_get_html($data->content);
// Go through every finisha of the model // Go through every finisha of the model
$list = $html->find('h2'); $list = $html->find('h3');
foreach ($list as $finish) { foreach ($list as $finish) {
$finish_name = $finish->plaintext; $finish_name = $finish->plaintext;
$motorizations = $finish->next_sibling()->find('li'); $motorizations = $finish->next_sibling()->find('li');