key; } /** * get item name and description by item id * * @param $itemId item id * @return $item item name and description */ function getItemText($itemId) { $json = file_get_contents(Summoner::API_URL.'static-data/na/v1.2/item/'.$itemId.'?api_key='.Summoner::API_KEY); $link = json_decode($json); $item = $link->name . ' '.$link->description; $item = str_replace("
", ' ', $item); $item = strip_tags($item); return $item; } function itemDescription($itemId) { $itemId_json = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/item/'.$itemId.'?api_key='.Summoner::API_KEY); $itemId_result = json_decode($itemId_json); $first_result = $itemId_result->name . ' '.$itemId_result->description; $replace_breakline = str_replace(array("
"), ' ', $first_result); $replace_space = strip_tags($replace_breakline); return $replace_space; } $apiKey = Summoner::API_KEY; $inputSummonerName = $_GET['userName']; $inputSummonerName = str_replace(" ", "", $inputSummonerName); $summonerName = strtolower($inputSummonerName); $summonerId = 0; $summonerJson = file_get_contents('https://na.api.pvp.net/api/lol/na/v1.4/summoner/by-name/' . $summonerName . '?api_key=' . $apiKey, true); $summoner = json_decode($summonerJson)->$summonerName; $summonerId = $summoner->id; $summonerName = $summoner->name; $summonerRevisionDate = $summoner->revisionDate; $summonerLevel = $summoner->summonerLevel; $profileId = $summoner->profileIconId; ?> Summoner <?php if($summonerName){ echo '- ' . $summonerName;} ?> - urgo.tk "> IF NOT, */ ?>
">
URGO.TK for NA
   
0){ echo '
SORRY, ERROR OCCURRED DUE TO ONE OR MORE FOLLOWING REASONS
:Bad request
:Unauthorized
:No summoner data found for any specified inputs
:Rate limit exceeded
:Internal server error
:Service unavailable
:You are special
'; exit; } else if($summonerName){ ?> (365 * 2)) { $epochString .= "several years "; $statusDotColor = "272727"; // 272727 gray } else if($epochDays > 365) { $epochString .= "over a year "; $statusDotColor = "272727"; // 272727 gray } else if($epochDays > 180) { $epochString .= "over 6 months "; $statusDotColor = "272727"; } else if($epochDays > 90) { $epochString .= "over 3 months "; $statusDotColor = "f00"; } else if($epochDays > 30) { $epochString .= "over a month "; $statusDotColor = "f00"; } else if($epochDays > 1) { $epochString .= $epochDays . " days "; $statusDotColor = "E5AE00"; } else if($epochDays == 1) { $epochString .= " a day "; $statusDotColor = "E5AE00"; //e76000 orange } if($epochDays < 2 && $epochHours > 1) { $epochString .= $epochHours . " hrs "; //$statusDotColor = "E5AE00"; //e5ae00 yellow } else if($epochDays < 2 && $epochHours == 1) { $epochString .= " an hr "; } if($epochDays == 0 && $epochMinutes > 1) { $epochString .= $epochMinutes . " mins "; } else if($epochDays == 0 && $epochMinutes == 1) { $epochString .= " one min "; } $epochString .= "ago"; if($epochDiffSeconds < (60 * 5) ) { $epochString = "active now"; } ?>
 ' ?> $summonerId; $summonerTier = $tier_result[0]->tier; $summonerDivision = $tier_result[0]->entries[0]->division; if (!$summonerTier){ $summonerTier = 'UNRANKED'; } /* if($summonerId == "36821462") { $summonerTier = 'CHALLENGER'; $summonerDivision = ''; } */ $summonerTier = ucfirst(strtolower($summonerTier)); ?>
games as $recentSummary){ var_dump($recentSummary->stats->championsKilled); } foreach( $recent->games as $recentSummary){ $FINAL_STATS_WIN = $recentSummary->stats->win; $FINAL_CHAMPIONID = $recentSummary->championId; $FINAL_STATS_WIN == 1 ? $letterWin = 'VICTORY' : $letterWin ='DEFEAT'; $subType = str_replace(array('_','1x1','2x2','3x3','5x5','6x6'), ' ', ucfirst(strtolower($recentSummary->subType))); if($recentSummary->subType == 'NONE'){ $subType = 'Custom'; } $result_champ_name_static_data = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/champion/'. $FINAL_CHAMPIONID .'?api_key=' . $apiKey); $champName = json_decode($result_champ_name_static_data); ?> stats->timePlayed ); $timePlayedSecond = gmdate('s', $recentSummary->stats->timePlayed ); ?>
'; echo date('M j Y g:s A', $recentSummary->createDate / 1000); echo '' . $timePlayedMinute. 'm ' . $timePlayedSecond . 's' .' '. $letterWin . ' '; ?>
spell1 .'?api_key=' . $apiKey); $summonerSpell1 = json_decode($json_spell1) ; $json_spell2 = file_get_contents('https://na.api.pvp.net/api/lol/static-data/na/v1.2/summoner-spell/'. $recentSummary->spell2 .'?api_key=' . $apiKey); $summonerSpell2 = json_decode($json_spell2) ; $spell1Name = $summonerSpell1 -> name; $spell2Name = $summonerSpell2 -> name; $spell1Key = $summonerSpell1 -> key; $spell2Key = $summonerSpell2 -> key; $spell1Description = $summonerSpell1 -> description; $spell2Description = $summonerSpell2 -> description; ?> stats->championsKilled ? $championsKilled = $recentSummary->stats->championsKilled : $championKilled = 0; $recentSummary->stats->numDeaths ? $numDeaths = $recentSummary->stats->numDeaths : $numDeaths = 0; $recentSummary->stats->assists ? $assists = $recentSummary->stats->assists : $assists = 0; echo '
'.$championsKilled.' / '.$numDeaths.' / '.$assists.'
' .'
'; if($championsKilled > 0 && $numDeaths == 0) { echo 'Perfect '; } else if($numDeaths > 0) { echo number_format( (($championsKilled + $assists) / $numDeaths), 2).':1 '; } else { echo $championsKilled + $assists . '.00:0 '; } echo 'KDA
'; $killTitle = ''; if($recentSummary->stats->firstBlood > 0) $killTitle = 'First Blood'; if($recentSummary->stats->doubleKills > 0) $killTitle = 'Double Kill'; if($recentSummary->stats->tripleKills > 0) $killTitle = 'Triple Kill'; if($recentSummary->stats->quadraKills > 0) $killTitle = 'Quadra Kill'; if($recentSummary->stats->pentaKills > 0) $killTitle = 'Penta Kill'; echo '
'. $killTitle . '
Level '.$recentSummary->stats->level.'
'; $recentSummary->stats->neutralMinionsKilledYourJungle ? $inTeamJungle = $recentSummary->stats->neutralMinionsKilledYourJungle : $inTeamJungle = 0; $recentSummary->stats->neutralMinionsKilledEnemyJungle ? $inEnemyJungle = $recentSummary->stats->neutralMinionsKilledEnemyJungle : $inEnemyJungle = 0; $recentSummary->stats->minionsKilled ? $minionsKilled = $recentSummary->stats->minionsKilled : $minionsKilled = 0; $recentSummary->stats->goldEarned ? $goldEarned = $recentSummary->stats->goldEarned : $goldEarned = 0; echo '
'.number_format(($goldEarned / 100), 1) .'k ('. ($minionGoldEarned) . ')
'; ?>
stats->item0){ ?> stats->item1){ ?> stats->item2){ ?> stats->item3){ ?> stats->item4){ ?> stats->item5){ ?> stats->item6){ ?>
stats->totalDamageDealtToChampions? $totalDealToChamp = $recentSummary->stats->totalDamageDealtToChampions : $totalDealToChamp = 0; $recentSummary->stats->totalDamageDealt ? $totalDeal = $recentSummary->stats->totalDamageDealt : $totalDeal = 0; echo' '; $recentSummary->ipEarned? $ipEarned = $recentSummary->ipEarned : $ipEarned = 0; echo '
+' . $ipEarned . ' IP
'; ?>