forked from La_Bureautique/zeg1jeux
Fix | fonction donneMoiSaPutaindeG1Pub() sur passerelle Libra
This commit is contained in:
parent
30a80cda2c
commit
f61db7a385
|
@ -78,6 +78,7 @@ class Fred {
|
||||||
return json_decode($json);
|
return json_decode($json);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function donneMoiSaPutaindeG1Pub ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
|
public function donneMoiSaPutaindeG1Pub ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -90,11 +91,20 @@ class Fred {
|
||||||
|
|
||||||
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
|
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
|
||||||
|
|
||||||
$page1 = file_get_contents($url)
|
$opts = array(
|
||||||
or die('<p>On a fait du sale.</p>');
|
'http'=>array(
|
||||||
|
'method'=>"GET",
|
||||||
|
'header'=>"Accept-language: fr\r\n",
|
||||||
|
'follow_location' => 0
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$context = stream_context_create($opts);
|
||||||
|
$page1 = file_get_contents($url, false, $context)
|
||||||
|
or die('<p>On a fait du sale.</p>');
|
||||||
|
|
||||||
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
||||||
|
|
||||||
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
||||||
|
|
||||||
// die(
|
// die(
|
||||||
|
@ -108,11 +118,23 @@ class Fred {
|
||||||
|
|
||||||
$page2 = '';
|
$page2 = '';
|
||||||
|
|
||||||
|
$opts2 = array(
|
||||||
|
'http'=>array(
|
||||||
|
'method'=>"GET",
|
||||||
|
'header'=>"Accept-language: fr\r\n",
|
||||||
|
'follow_location' => 0
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$context2 = stream_context_create($opts2);
|
||||||
|
|
||||||
|
sleep(3);
|
||||||
|
|
||||||
while (empty($page2)) {
|
while (empty($page2)) {
|
||||||
|
|
||||||
sleep($this->gatewayDelay);
|
sleep($this->gatewayDelay);
|
||||||
|
|
||||||
$page2 = @file_get_contents($url);
|
$page2 = file_get_contents($url, false, $context2) or die('<pre>'. var_dump($page2, true) . '</pre>');
|
||||||
}
|
}
|
||||||
|
|
||||||
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
||||||
|
|
Loading…
Reference in New Issue