diff --git a/scripts/jobs/getBodaccPdf.php b/scripts/jobs/getBodaccPdf.php index 0f451a17a..6890220a2 100644 --- a/scripts/jobs/getBodaccPdf.php +++ b/scripts/jobs/getBodaccPdf.php @@ -90,8 +90,8 @@ echo "\n"; $result = getPage($url, $data); if ($debug) file_put_contents('bodacc1.html', $result['content']); -echo $url = $site."/annonce/liste"; -echo "\n"; +$url = $site."/annonce/liste"; +echo $url."\n"; $data = array( 'categorieannonce' => 'tout', 'commercant' => '', @@ -107,13 +107,14 @@ $data = array( ); $result = getPage($url, $data); if ($debug) file_put_contents('bodacc2.html', $result['content']); -preg_match('/\/', $result['content'], $matches); - -echo $url = $site.'/annonce/detail/'.$matches[1]; -echo "\n"; +preg_match('/\/', $result['content'], $matches); +$url = null; +if (count($matches) > 0) { + $url = $site.'/annonce/detail-annonce/'.$matches[1]; + echo $url."\n"; +} if (empty($url)) { - echo "Erreur téléchargement du PDF."; - echo "\n"; + echo "Erreur Detail de l'annonce.\n"; exit; } @@ -129,12 +130,10 @@ Téléchargez le témoin de publication
*/ preg_match('/\