Remonter
Descendre

 


'); $guerres_gagnees = $parsed_json1->{'warWins'}; $guerres_egales = $parsed_json1->{'warTies'}; $guerres_perdues = $parsed_json1->{'warLosses'}; $guerres_serie = $parsed_json1->{'warWinStreak'}; $total = $guerres_gagnees + $guerres_egales + $guerres_perdues; echo ''; echo ''; echo ''; echo '
'; echo (''); echo ''; echo (''); echo ''; echo (''); echo '
'; echo ($guerres_gagnees); echo '
'; echo (''); echo ''; echo (''); echo '
'; echo ($guerres_perdues); echo '
'; echo (''); echo ''; echo (''); echo '
'; echo ($guerres_egales); echo '
'; echo (''); echo ''; echo (''); echo '
'; echo ($total); echo '
'; echo ('
'); echo '
'; /* ------------------------------------------------------------------ */ $url = 'https://api.clashofclans.com/v1/clans/%23....blablabla replace by your own clan id/warlog'; $ch = curl_init(htmlspecialchars($url)); $headr = array(); $headr[] = 'Accept: application/json'; $headr[] = 'Authorization: Bearer '.$accesstoken; curl_setopt($ch, CURLOPT_HTTPHEADER, $headr); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $json = curl_exec($ch); $parsed_json = json_decode($json); for ($i=0; $i < 50; $i++) { $result = $parsed_json->{'items'}[$i]->{'result'}; if (preg_match('/win/',$result)){echo '
';} else {echo '
';} echo '
'; echo ''; echo ''; echo ''; echo '
'; $fin = $parsed_json->{'items'}[$i]->{'endTime'}; $an = substr ( $fin , 0 , 4 ); $mois = substr ( $fin , 4 , 2 ); $jour = substr ( $fin , 6 , 2 ); echo''.$jour. '/' .$mois. '/' .$an.''; echo ''; $experience = $parsed_json->{'items'}[$i]->{'clan'}->{'expEarned'}; echo (''); echo'+'.$experience.''; echo ''; $nom_du_clan = $parsed_json->{'items'}[$i]->{'clan'}->{'name'}; echo''.$nom_du_clan.''; echo '
'; $pourcentage = $parsed_json->{'items'}[$i]->{'clan'}->{'destructionPercentage'}; echo''.$pourcentage.'%'; echo (''); $etoile = $parsed_json->{'items'}[$i]->{'clan'}->{'stars'}; echo''.$etoile.''; echo '
'; $blason_du_clan = $parsed_json->{'items'}[$i]->{'clan'}->{'badgeUrls'}->{'small'}; echo''; echo ' '; $blason_opposant = $parsed_json->{'items'}[$i]->{'opponent'}->{'badgeUrls'}->{'small'}; echo''; echo '
'; $taille_du_clan = $parsed_json->{'items'}[$i]->{'teamSize'}; echo''.$taille_du_clan.' contre '.$taille_du_clan.''; echo '
'; $nom_opposant = $parsed_json->{'items'}[$i]->{'opponent'}->{'name'}; echo''.$nom_opposant.''; echo '
'; echo (''); $etoile_opposant = $parsed_json->{'items'}[$i]->{'opponent'}->{'stars'}; echo''.$etoile_opposant.''; $pourcentage_opposant = $parsed_json->{'items'}[$i]->{'opponent'}->{'destructionPercentage'}; echo''.$pourcentage_opposant.'%'; echo '
'; echo '
'; echo '
'; echo '
'; } ?>