Ouch, c'était salé (mais pas poivré, loool)
This commit is contained in:
parent
bf34c4afe8
commit
04d951a129
|
@ -21,17 +21,25 @@ class Fred {
|
||||||
|
|
||||||
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper);
|
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper);
|
||||||
|
|
||||||
$page1 = @file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query)
|
$page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query);
|
||||||
or die('<p>On a fait du sale.</p>');
|
|
||||||
|
|
||||||
|
if (empty($page1)) {
|
||||||
|
|
||||||
|
throw Exception("J'ai pas pû récupérer la putain de première page.");
|
||||||
|
}
|
||||||
|
|
||||||
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
||||||
|
|
||||||
$url = $matches[1];
|
$url = $matches[1];
|
||||||
|
|
||||||
sleep($this->gatewayDelay);
|
sleep($this->gatewayDelay);
|
||||||
|
|
||||||
$page2 = @file_get_contents($url)
|
$page2 = file_get_contents($url);
|
||||||
or die('</p>On a chié dans la colle.</p>');
|
|
||||||
|
if (empty($page2)) {
|
||||||
|
|
||||||
|
throw Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
||||||
|
}
|
||||||
|
|
||||||
preg_match("`url='.*/ipns/([^']+)'`isU", $page2, $matches);
|
preg_match("`url='.*/ipns/([^']+)'`isU", $page2, $matches);
|
||||||
|
|
||||||
|
@ -52,8 +60,12 @@ class Fred {
|
||||||
|
|
||||||
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
|
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
|
||||||
|
|
||||||
$page1 = file_get_contents($url)
|
$page1 = file_get_contents($url);
|
||||||
or die('<p>On a fait du sale.</p>');
|
|
||||||
|
if (empty($page1)) {
|
||||||
|
|
||||||
|
throw Exception("J'ai pas pû récupérer la putain de première page.");
|
||||||
|
}
|
||||||
|
|
||||||
// echo '<pre>'; var_dump(htmlspecialchars($page1)); echo '</pre>';
|
// echo '<pre>'; var_dump(htmlspecialchars($page1)); echo '</pre>';
|
||||||
|
|
||||||
|
@ -64,11 +76,17 @@ class Fred {
|
||||||
// echo '<pre>'; var_dump($url); echo '</pre>';
|
// echo '<pre>'; var_dump($url); echo '</pre>';
|
||||||
|
|
||||||
$page2 = '';
|
$page2 = '';
|
||||||
|
$rounds = 0;
|
||||||
|
|
||||||
while (empty($page2)) {
|
while (empty($page2) and $rounds < 10) {
|
||||||
|
|
||||||
sleep($this->gatewayDelay);
|
sleep($this->gatewayDelay);
|
||||||
$page2 = @file_get_contents($url);
|
$page2 = file_get_contents($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($page2)) {
|
||||||
|
|
||||||
|
throw Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo '<pre>'; var_dump(htmlspecialchars($page2)); echo '</pre>';
|
// echo '<pre>'; var_dump(htmlspecialchars($page2)); echo '</pre>';
|
||||||
|
@ -85,7 +103,7 @@ class Fred {
|
||||||
$salt = $prenomNom;
|
$salt = $prenomNom;
|
||||||
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
||||||
|
|
||||||
$query = 'salt='. $salt .'&pepper='. $pepper . '&g1pub=on';
|
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&g1pub=on';
|
||||||
|
|
||||||
$url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
|
$url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
|
||||||
|
|
||||||
|
@ -101,9 +119,14 @@ class Fred {
|
||||||
|
|
||||||
$context = stream_context_create($opts);
|
$context = stream_context_create($opts);
|
||||||
|
|
||||||
|
|
||||||
$page1 = file_get_contents($url, false, $context);
|
$page1 = file_get_contents($url, false, $context);
|
||||||
|
|
||||||
|
|
||||||
|
if (empty($page1)) {
|
||||||
|
|
||||||
|
throw Exception("J'ai pas pû récupérer la putain de première page.");
|
||||||
|
}
|
||||||
|
|
||||||
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
||||||
|
|
||||||
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
||||||
|
@ -117,8 +140,6 @@ class Fred {
|
||||||
|
|
||||||
// die('<pre>' . var_dump($url, true) . '</pre>');
|
// die('<pre>' . var_dump($url, true) . '</pre>');
|
||||||
|
|
||||||
$page2 = '';
|
|
||||||
|
|
||||||
$opts2 = array(
|
$opts2 = array(
|
||||||
'http'=>array(
|
'http'=>array(
|
||||||
'method'=>"GET",
|
'method'=>"GET",
|
||||||
|
@ -129,20 +150,26 @@ class Fred {
|
||||||
|
|
||||||
$context2 = stream_context_create($opts2);
|
$context2 = stream_context_create($opts2);
|
||||||
|
|
||||||
sleep(3);
|
$page2 = '';
|
||||||
|
|
||||||
while (empty($page2)) {
|
$rounds = 0;
|
||||||
|
|
||||||
|
while (empty($page2) and $rounds < 10) {
|
||||||
|
|
||||||
sleep($this->gatewayDelay);
|
sleep($this->gatewayDelay);
|
||||||
|
|
||||||
$page2 = file_get_contents($url, false, $context2);
|
$page2 = file_get_contents($url, false, $context2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($page2)) {
|
||||||
|
|
||||||
|
throw Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
||||||
|
}
|
||||||
|
|
||||||
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
||||||
|
|
||||||
$gchangeId = $matches[1];
|
$gchangeId = $matches[1];
|
||||||
|
|
||||||
return $gchangeId;
|
return $gchangeId;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -20,7 +20,7 @@ if (isset($_POST['salt'], $_POST['pepper'])) {
|
||||||
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
|
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
|
||||||
|
|
||||||
} catch (Exception $errMsg) {
|
} catch (Exception $errMsg) {
|
||||||
|
|
||||||
ErrorsHandler::kaput($errMsg);
|
ErrorsHandler::kaput($errMsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue