forked from La_Bureautique/zeg1jeux
125 lines
3.0 KiB
PHP
125 lines
3.0 KiB
PHP
<?php
|
|
|
|
class Fred {
|
|
|
|
private $gatewayProtocol = 'http';
|
|
|
|
private $gatewayDomain = 'libra.copylaradio.com';
|
|
|
|
private $gatewayPort = '1234';
|
|
|
|
private $gatewayDelay = 3;
|
|
|
|
public function __construct () {
|
|
|
|
}
|
|
|
|
public function donneMoiLaPutainDeClefIPNS ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
|
|
|
|
$salt = $prenomNom;
|
|
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
|
|
|
$query = 'salt='. $salt .'&pepper='. $pepper;
|
|
|
|
$page1 = @file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query)
|
|
or die('<p>On a fait du sale.</p>');
|
|
|
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
|
|
|
$url = $matches[1];
|
|
|
|
sleep($this->gatewayDelay);
|
|
|
|
$page2 = @file_get_contents($url)
|
|
or die('</p>On a chié dans la colle.</p>');
|
|
|
|
preg_match("`url='.*/ipns/([^']+)'`isU", $page2, $matches);
|
|
|
|
$ipnsKey = $matches[1];
|
|
|
|
return $ipnsKey;
|
|
}
|
|
|
|
public function donneMoiSesPutainDeMessagesGchange ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday, $gchangeName) {
|
|
|
|
|
|
$salt = $prenomNom;
|
|
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
|
|
|
$query = 'salt='. $salt .'&pepper='. $pepper . '&messaging=' . $gchangeName;
|
|
|
|
$url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
|
|
|
|
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
|
|
|
|
$page1 = file_get_contents($url)
|
|
or die('<p>On a fait du sale.</p>');
|
|
|
|
// echo '<pre>'; var_dump(htmlspecialchars($page1)); echo '</pre>';
|
|
|
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
|
|
|
$url = $matches[1];
|
|
|
|
// echo '<pre>'; var_dump($url); echo '</pre>';
|
|
|
|
$page2 = '';
|
|
|
|
while (empty($page2)) {
|
|
|
|
sleep($this->gatewayDelay);
|
|
$page2 = @file_get_contents($url);
|
|
}
|
|
|
|
// echo '<pre>'; var_dump(htmlspecialchars($page2)); echo '</pre>';
|
|
|
|
$json = $page2;
|
|
|
|
return json_decode($json);
|
|
|
|
}
|
|
public function donneMoiSaPutaindeG1Pub ($prenomNom, $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday) {
|
|
|
|
|
|
$salt = $prenomNom;
|
|
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
|
|
|
$query = 'salt='. $salt .'&pepper='. $pepper . '&g1pub=on';
|
|
|
|
$url = $this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query;
|
|
|
|
// echo '<pre>'; var_dump(htmlspecialchars($url)); echo '</pre>';
|
|
|
|
$page1 = file_get_contents($url)
|
|
or die('<p>On a fait du sale.</p>');
|
|
|
|
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
|
|
|
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
|
|
|
// die(
|
|
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
|
|
// '<pre>' . print_r($matches, true) . '</pre>'
|
|
// );
|
|
|
|
$url = $matches[1];
|
|
|
|
// die('<pre>' . var_dump($url, true) . '</pre>');
|
|
|
|
$page2 = '';
|
|
|
|
while (empty($page2)) {
|
|
|
|
sleep($this->gatewayDelay);
|
|
|
|
$page2 = @file_get_contents($url);
|
|
}
|
|
|
|
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);
|
|
|
|
$gchangeId = $matches[1];
|
|
|
|
return $gchangeId;
|
|
|
|
}
|
|
} |