1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
<?php
$nom = '*****';
$pass = '*********';
$host='http://*******.fr/';
$url = $host.'allianz.php';
$referer = $host.'login.php';
$doc = new DOMDocument();
@$doc->loadHTMLFile($referer);
$tags = $doc->getElementsByTagName('input');
foreach ($tags as $key=>$tag) {
if ($key == 1){$login_value =$tag->getAttribute('value');}
if ($key == 2){$input_name =$tag->getAttribute('name');}
if ($key == 3){$input_pass = $tag->getAttribute('name');}
if ($key == 4){$input_blank =$tag->getAttribute('name');$blank_value =$tag->getAttribute('value');}
}
//unset($doc,$tags);
// voici nos variables POST de connexion
$data = array(
'w'=>'1024:768',//résolution écran// nécéssaire pour le width du td comme critère d'extraction html ?
'login'=>$login_value,//id de login = unix time stamp
"$input_name" =>$nom,//Mon pseudo - les noms de champs changent
"$input_pass"=>$pass,//Mon pass
"$input_blank"=> $blank_value,//?
's1.x'=>25,//?
's1.y'=>10,//?
's1'=>'login',//?
's'=>3 //pour la page allianz?s=3
);
// Envoie la première requête
list($header, $content) = HttpRequest($url,$referer,$data,'POST');
$liste = new DOMDocument();//ob_start();
@$liste->loadHTML($content);//ob_end_clean();
$raw = $liste->getElementsByTagName('td');
//$resultat = array();
//on extrait les données de la page d'attaque alliance : sujet(att/espio) - attaquant - ally att - def - ally def - date - heure - idberichte
foreach ($raw as $key=>$node) {
echo('(');
if (($node->getAttribute('class') == 's7')&& ($node->nodeValue != " ")){
echo $resultat['ids'][] = substr(@$node->firstChild->getAttribute('href') , 16 );
echo $resultat['sujet'][] = (strstr($node->nodeValue,'attaque') != "") ? 'attaque' : 'espionne' ;
$players = explode(((strstr($node->nodeValue,'attaque') != "") ? 'attaque' : 'espionne'),$node->nodeValue);
echo $resultat['attaquant'][] = trim($players[0]);
echo $resultat['defenseur'][] = trim($players[1]);
}
if (($node->getAttribute('class') == 'c f8')&& ($node->nodeValue != " ")){
$ally = explode(" - ",$node->nodeValue);
echo $resultat['allyatt'][] = $ally[0];
echo $resultat['allydef'][] = $ally[1];
}
if (($node->getAttribute('width') == 110)&& ($node->nodeValue != " ")){
$d = explode(".", substr($node->nodeValue,0,8));//$d[0] $d[1] $d[2] // jour.mois.année
$h = explode(":",substr($node->nodeValue,9));//$h[0] $h[1] // heure : minutes
echo $resultat['unix'][] = mktime($h[0] , $h[1] , 0, $d[1] , $d[0],$d[2] );
}
echo ')';
}
var_dump($resultat['ids']); // ne marche pas
echo 'fin'; // ne marche pas non plus :o |
Partager