Merge branch 'hotfix-bodaccpdf' into develop
Conflicts: .gitignore
This commit is contained in:
commit
4425400587
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,4 +1,11 @@
|
||||
<<<<<<< HEAD
|
||||
/.settings/
|
||||
/.buildpath
|
||||
/.project
|
||||
/vendor/
|
||||
=======
|
||||
/vendor/
|
||||
/.buildpath
|
||||
/.project
|
||||
/.settings/
|
||||
>>>>>>> refs/heads/hotfix-bodaccpdf
|
||||
|
@ -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('/\<a href="\/annonce\/detail\/(.*)"\>/', $result['content'], $matches);
|
||||
|
||||
echo $url = $site.'/annonce/detail/'.$matches[1];
|
||||
echo "\n";
|
||||
preg_match('/\<a href="\/annonce\/detail-annonce\/(.*)"\>/', $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
|
||||
</p>
|
||||
*/
|
||||
preg_match('/\<a href="\/annonce\/telecharger\/(.*)"/', $result['content'], $matches);
|
||||
|
||||
echo $url = $site.'/annonce/telecharger/'.$matches[1];
|
||||
echo "\n";
|
||||
if (empty($url)) {
|
||||
echo "Erreur téléchargement du PDF.";
|
||||
echo "\n";
|
||||
echo "Erreur téléchargement du PDF.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -142,8 +141,7 @@ if (empty($url)) {
|
||||
$result = getPage($url);
|
||||
if (substr($result['content'],0,4)!='%PDF'){
|
||||
if ($debug) file_put_contents('bodacc4.html', $result['content']);
|
||||
echo "Erreur téléchargement du PDF.";
|
||||
echo "\n";
|
||||
echo "Erreur téléchargement du PDF.\n";
|
||||
exit;
|
||||
}
|
||||
file_put_contents($directory."/BODACC_".$type."_".$annee."_".$num.".pdf", $result['content']);
|
||||
|
Loading…
Reference in New Issue
Block a user