forked from La_Bureautique/zeg1jeux
loop on PORT
This commit is contained in:
parent
e25914e36b
commit
5ab3381d5f
|
@ -8,7 +8,7 @@ class Fred {
|
|||
|
||||
private $gatewayPort = ''; // :1234
|
||||
|
||||
private $gatewayDelay = 5;
|
||||
private $gatewayDelay = 3;
|
||||
|
||||
public function __construct () {
|
||||
|
||||
|
@ -32,15 +32,21 @@ class Fred {
|
|||
|
||||
$url = $matches[1];
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
$page2 = '';
|
||||
$rounds = 0;
|
||||
|
||||
$page2 = file_get_contents($url);
|
||||
while (empty($page2) and $rounds < 10) {
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
$page2 = file_get_contents($url);
|
||||
}
|
||||
|
||||
if (empty($page2)) {
|
||||
|
||||
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
||||
}
|
||||
|
||||
|
||||
preg_match("`url='.*/ipns/([^']+)'`isU", $page2, $matches);
|
||||
|
||||
$ipnsKey = $matches[1];
|
||||
|
@ -138,15 +144,21 @@ class Fred {
|
|||
|
||||
$url = $matches[1];
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
$page2 = '';
|
||||
$rounds = 0;
|
||||
|
||||
$page2 = file_get_contents($url);
|
||||
while (empty($page2) and $rounds < 10) {
|
||||
|
||||
sleep($this->gatewayDelay);
|
||||
$page2 = file_get_contents($url);
|
||||
}
|
||||
|
||||
if (empty($page2)) {
|
||||
|
||||
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
||||
}
|
||||
|
||||
|
||||
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
||||
|
||||
$gchangeId = $matches[1];
|
||||
|
|
Loading…
Reference in New Issue