|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
class Fred {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private $gatewayProtocol = 'http';
|
|
|
|
|
|
|
|
|
|
// private $gatewayDomain = 'libra.copylaradio.com';
|
|
|
|
|
private $gatewayDomain = 'libra.copylaradio.com';
|
|
|
|
|
// private $gatewayDomain = 'aries.copylaradio.com';
|
|
|
|
|
private $gatewayDomain = 'astroport.localhost';
|
|
|
|
|
// private $gatewayDomain = 'astroport.localhost';
|
|
|
|
|
|
|
|
|
|
private $gatewayPort = '1234';
|
|
|
|
|
|
|
|
|
@ -27,20 +27,21 @@ class Fred {
|
|
|
|
|
$salt = $prenomNom;
|
|
|
|
|
$pepper = $nomDuChienSuivieDeLaDateDeNaissanceDeJohnnyHallyday;
|
|
|
|
|
|
|
|
|
|
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper);
|
|
|
|
|
$query = 'salt='. urlencode($salt) .'&pepper='. urlencode($pepper) . '&getipns=on';
|
|
|
|
|
|
|
|
|
|
$page1 = file_get_contents($this->gatewayProtocol . '://'. $this->gatewayDomain .':' . $this->gatewayPort . '/?' . $query);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (empty($page1)) {
|
|
|
|
|
|
|
|
|
|
throw new Exception("J'ai pas pû récupérer la putain de première page.");
|
|
|
|
|
throw new Exception("J'ai pas pû récupérer la putain de première page.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
|
|
|
|
|
|
|
|
|
$url = $matches[1];
|
|
|
|
|
$url .= '/?'. $query;
|
|
|
|
|
|
|
|
|
|
die($url);
|
|
|
|
|
// die($url);
|
|
|
|
|
$opts2 = array(
|
|
|
|
|
'http'=>array(
|
|
|
|
|
'method'=>"GET",
|
|
|
|
@ -49,7 +50,7 @@ class Fred {
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
echo 'fred 2';
|
|
|
|
|
// echo 'fred 2';
|
|
|
|
|
|
|
|
|
|
$context2 = stream_context_create($opts2);
|
|
|
|
|
|
|
|
|
@ -77,7 +78,7 @@ class Fred {
|
|
|
|
|
throw new Exception("J'ai pas pû récupérer la putain de deuxième page.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
preg_match("`url='.*/ipns/([^']+)'`isU", $page2, $matches);
|
|
|
|
|
preg_match("`/ipns/(.+)`is", $page2, $matches);
|
|
|
|
|
|
|
|
|
|
$ipnsKey = $matches[1];
|
|
|
|
|
|
|
|
|
@ -170,8 +171,8 @@ class Fred {
|
|
|
|
|
preg_match("`url='([^']+)'`isU", $page1, $matches);
|
|
|
|
|
|
|
|
|
|
// die(
|
|
|
|
|
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
|
|
|
|
|
// '<pre>' . print_r($matches, true) . '</pre>'
|
|
|
|
|
// '<pre>' . htmlspecialchars($page1) . '</pre>' .
|
|
|
|
|
// '<pre>' . print_r($matches, true) . '</pre>'
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
$url = $matches[1];
|
|
|
|
|