ranks on frontpage #148
BIN
images/ranks/Bronze-1.png
Normal file
|
After Width: | Height: | Size: 444 KiB |
BIN
images/ranks/Bronze-2.png
Normal file
|
After Width: | Height: | Size: 443 KiB |
BIN
images/ranks/Bronze-3.png
Normal file
|
After Width: | Height: | Size: 445 KiB |
BIN
images/ranks/Bronze-4.png
Normal file
|
After Width: | Height: | Size: 452 KiB |
BIN
images/ranks/Bronze-5.png
Normal file
|
After Width: | Height: | Size: 446 KiB |
BIN
images/ranks/Diamond-1.png
Normal file
|
After Width: | Height: | Size: 456 KiB |
BIN
images/ranks/Diamond-2.png
Normal file
|
After Width: | Height: | Size: 458 KiB |
BIN
images/ranks/Diamond-3.png
Normal file
|
After Width: | Height: | Size: 463 KiB |
BIN
images/ranks/Diamond-4.png
Normal file
|
After Width: | Height: | Size: 459 KiB |
BIN
images/ranks/Diamond-5.png
Normal file
|
After Width: | Height: | Size: 465 KiB |
BIN
images/ranks/Gold-1.png
Normal file
|
After Width: | Height: | Size: 516 KiB |
BIN
images/ranks/Gold-2.png
Normal file
|
After Width: | Height: | Size: 498 KiB |
BIN
images/ranks/Gold-3.png
Normal file
|
After Width: | Height: | Size: 495 KiB |
BIN
images/ranks/Gold-4.png
Normal file
|
After Width: | Height: | Size: 505 KiB |
BIN
images/ranks/Gold-5.png
Normal file
|
After Width: | Height: | Size: 491 KiB |
BIN
images/ranks/Master.png
Normal file
|
After Width: | Height: | Size: 398 KiB |
BIN
images/ranks/Platinum-1.png
Normal file
|
After Width: | Height: | Size: 311 KiB |
BIN
images/ranks/Platinum-2.png
Normal file
|
After Width: | Height: | Size: 314 KiB |
BIN
images/ranks/Platinum-3.png
Normal file
|
After Width: | Height: | Size: 315 KiB |
BIN
images/ranks/Platinum-4.png
Normal file
|
After Width: | Height: | Size: 315 KiB |
BIN
images/ranks/Platinum-5.png
Normal file
|
After Width: | Height: | Size: 312 KiB |
BIN
images/ranks/Silver-1.png
Normal file
|
After Width: | Height: | Size: 365 KiB |
BIN
images/ranks/Silver-2.png
Normal file
|
After Width: | Height: | Size: 371 KiB |
BIN
images/ranks/Silver-3.png
Normal file
|
After Width: | Height: | Size: 358 KiB |
BIN
images/ranks/Silver-4.png
Normal file
|
After Width: | Height: | Size: 366 KiB |
BIN
images/ranks/Silver-5.png
Normal file
|
After Width: | Height: | Size: 351 KiB |
BIN
images/ranks/Unranked.png
Normal file
|
After Width: | Height: | Size: 426 KiB |
|
|
@ -13,6 +13,15 @@ body {
|
|||
-o-background-size: cover;
|
||||
background-size: cover;
|
||||
}
|
||||
.table-image {
|
||||
max-height: 50px;
|
||||
max-width: 50px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
nav {
|
||||
background: linear-gradient(to right, #FF416C, #FF4B2B);
|
||||
|
|
|
|||
24
index.php
|
|
@ -93,14 +93,31 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
|||
//CLANINFO
|
||||
$clanInfoPath = './data/claninfo.json';
|
||||
$clanmembersfile = './config/clanmembers.json';
|
||||
$rankedfile = './data/player_season_data.json';
|
||||
$clanmembers = json_decode(file_get_contents($clanmembersfile), true);
|
||||
$playerRanks = json_decode(file_get_contents($rankedfile), true);
|
||||
if (file_exists($clanInfoPath)) {
|
||||
$clan = json_decode(file_get_contents($clanInfoPath), true);
|
||||
if (isset($clan) && !empty($clan)) {
|
||||
echo "<table>";
|
||||
echo "<tr><th>Attribute</th><th>Value</th></tr>";
|
||||
echo "<tr><th>Attribute</th><th>Value</th><th>Rank(FPP SQUAD)</th><th>Points</th></tr>";
|
||||
foreach ($clanmembers['clanMembers'] as $value) {
|
||||
echo "<tr><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>name</a></td><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>" . htmlspecialchars($value) . "</a></td></tr>";
|
||||
foreach ($playerRanks as $rank) {
|
||||
|
||||
if ($rank['name'] == $value) {
|
||||
if (isset($rank['stat']['data']['attributes']['rankedGameModeStats']['squad-fpp'])) {
|
||||
$tier = $rank['stat']['data']['attributes']['rankedGameModeStats']['squad-fpp']['currentTier']['tier'];
|
||||
$subTier = $rank['stat']['data']['attributes']['rankedGameModeStats']['squad-fpp']['currentTier']['subTier'];
|
||||
$image = "./images/ranks/" . $tier . "-" . $subTier . ".png";
|
||||
$rankPoint = htmlspecialchars($rank['stat']['data']['attributes']['rankedGameModeStats']['squad-fpp']['currentRankPoint']);
|
||||
echo "<tr><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>name</a></td><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>" . htmlspecialchars($value) . "</a></td><td><img src='" . $image . "' class='table-image'></td><td>" . $rankPoint . "</td></tr>";
|
||||
} else {
|
||||
echo "<tr><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>name</a></td><td><a href='latestmatches.php?selected_player=" . htmlspecialchars($value) . "'>" . htmlspecialchars($value) . "</a></td><td><img src='./images/ranks/Unranked.png' class='table-image'></td><td></td></tr>";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
foreach ($clan as $key => $value) {
|
||||
if ($key == 'updated') {
|
||||
|
|
@ -108,12 +125,11 @@ $lastMatches = array_slice($allMatches, 0, 8);
|
|||
}
|
||||
echo "<tr><td>" . htmlspecialchars($key) . "</td><td>" . htmlspecialchars($value) . "</td></tr>";
|
||||
}
|
||||
|
||||
|
||||
echo "</table>";
|
||||
} else {
|
||||
echo "<p>No clan attributes available</p>";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "<p>Clan info file missing</p>";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,12 +46,12 @@ if ($chunk.Count -gt 0) {
|
|||
}
|
||||
$clanMembers = $clanMembersArray -join ','
|
||||
|
||||
|
||||
|
||||
$headers = @{
|
||||
'accept' = 'application/vnd.api+json'
|
||||
'Authorization' = "$apiKey"
|
||||
}
|
||||
|
||||
|
||||
$playerinfo = @()
|
||||
foreach ($key in $clanmemberchunks.keys) {
|
||||
|
||||
|
|
@ -172,3 +172,29 @@ $lifetimestats['updated'] = $formattedString
|
|||
$lifetimestats | convertto-json -Depth 100 | out-file "$scriptroot/../data/player_lifetime_data.json"
|
||||
remove-lock
|
||||
Stop-Transcript
|
||||
|
||||
$seasons = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/seasons" -Method GET -Headers $headers
|
||||
$current_season = $seasons.data | Where-Object {$_.attributes.isCurrentSeason -eq $true}
|
||||
|
||||
$i = 0
|
||||
$seasonstats = @()
|
||||
while($playerinfo.data.Count -gt $i) {
|
||||
write-host $clanMembersArray[$i]
|
||||
|
||||
try{
|
||||
$rankedstat = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/players/$($playerinfo.data[$i].id)/seasons/$($current_season.id)/ranked" -Method GET -Headers $headers
|
||||
}catch{
|
||||
write-output 'sleeping for 61 seconds'
|
||||
start-sleep -Seconds 61
|
||||
$rankedstat = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/players/$($playerinfo.data[$i].id)/seasons/$($current_season.id)/ranked" -Method GET -Headers $headers
|
||||
}
|
||||
|
||||
$seasonstats += [PSCustomObject]@{
|
||||
stat = $rankedstat
|
||||
name = $playerinfo.data[$i].attributes.name
|
||||
}
|
||||
|
||||
$i++
|
||||
|
||||
}
|
||||
$seasonstats | convertto-json -Depth 100| Out-File "$scriptroot/../data/player_season_data.json"
|
||||