diff --git a/images/ranks/Bronze-1.png b/images/ranks/Bronze-1.png new file mode 100644 index 0000000..8893900 Binary files /dev/null and b/images/ranks/Bronze-1.png differ diff --git a/images/ranks/Bronze-2.png b/images/ranks/Bronze-2.png new file mode 100644 index 0000000..feb7722 Binary files /dev/null and b/images/ranks/Bronze-2.png differ diff --git a/images/ranks/Bronze-3.png b/images/ranks/Bronze-3.png new file mode 100644 index 0000000..66272a4 Binary files /dev/null and b/images/ranks/Bronze-3.png differ diff --git a/images/ranks/Bronze-4.png b/images/ranks/Bronze-4.png new file mode 100644 index 0000000..c298e33 Binary files /dev/null and b/images/ranks/Bronze-4.png differ diff --git a/images/ranks/Bronze-5.png b/images/ranks/Bronze-5.png new file mode 100644 index 0000000..56761ca Binary files /dev/null and b/images/ranks/Bronze-5.png differ diff --git a/images/ranks/Diamond-1.png b/images/ranks/Diamond-1.png new file mode 100644 index 0000000..78b8293 Binary files /dev/null and b/images/ranks/Diamond-1.png differ diff --git a/images/ranks/Diamond-2.png b/images/ranks/Diamond-2.png new file mode 100644 index 0000000..475b922 Binary files /dev/null and b/images/ranks/Diamond-2.png differ diff --git a/images/ranks/Diamond-3.png b/images/ranks/Diamond-3.png new file mode 100644 index 0000000..5f193f8 Binary files /dev/null and b/images/ranks/Diamond-3.png differ diff --git a/images/ranks/Diamond-4.png b/images/ranks/Diamond-4.png new file mode 100644 index 0000000..b504557 Binary files /dev/null and b/images/ranks/Diamond-4.png differ diff --git a/images/ranks/Diamond-5.png b/images/ranks/Diamond-5.png new file mode 100644 index 0000000..9d5541c Binary files /dev/null and b/images/ranks/Diamond-5.png differ diff --git a/images/ranks/Gold-1.png b/images/ranks/Gold-1.png new file mode 100644 index 0000000..1accd3e Binary files /dev/null and b/images/ranks/Gold-1.png differ diff --git a/images/ranks/Gold-2.png b/images/ranks/Gold-2.png new file mode 100644 index 0000000..1586122 Binary files /dev/null and b/images/ranks/Gold-2.png differ diff --git a/images/ranks/Gold-3.png b/images/ranks/Gold-3.png new file mode 100644 index 0000000..cbf0a73 Binary files /dev/null and b/images/ranks/Gold-3.png differ diff --git a/images/ranks/Gold-4.png b/images/ranks/Gold-4.png new file mode 100644 index 0000000..0a9fd39 Binary files /dev/null and b/images/ranks/Gold-4.png differ diff --git a/images/ranks/Gold-5.png b/images/ranks/Gold-5.png new file mode 100644 index 0000000..744d52a Binary files /dev/null and b/images/ranks/Gold-5.png differ diff --git a/images/ranks/Master.png b/images/ranks/Master.png new file mode 100644 index 0000000..6b97deb Binary files /dev/null and b/images/ranks/Master.png differ diff --git a/images/ranks/Platinum-1.png b/images/ranks/Platinum-1.png new file mode 100644 index 0000000..b5546c1 Binary files /dev/null and b/images/ranks/Platinum-1.png differ diff --git a/images/ranks/Platinum-2.png b/images/ranks/Platinum-2.png new file mode 100644 index 0000000..341d8c4 Binary files /dev/null and b/images/ranks/Platinum-2.png differ diff --git a/images/ranks/Platinum-3.png b/images/ranks/Platinum-3.png new file mode 100644 index 0000000..d0c9979 Binary files /dev/null and b/images/ranks/Platinum-3.png differ diff --git a/images/ranks/Platinum-4.png b/images/ranks/Platinum-4.png new file mode 100644 index 0000000..9f72959 Binary files /dev/null and b/images/ranks/Platinum-4.png differ diff --git a/images/ranks/Platinum-5.png b/images/ranks/Platinum-5.png new file mode 100644 index 0000000..9c66de8 Binary files /dev/null and b/images/ranks/Platinum-5.png differ diff --git a/images/ranks/Silver-1.png b/images/ranks/Silver-1.png new file mode 100644 index 0000000..484e484 Binary files /dev/null and b/images/ranks/Silver-1.png differ diff --git a/images/ranks/Silver-2.png b/images/ranks/Silver-2.png new file mode 100644 index 0000000..e9a9ab7 Binary files /dev/null and b/images/ranks/Silver-2.png differ diff --git a/images/ranks/Silver-3.png b/images/ranks/Silver-3.png new file mode 100644 index 0000000..3640586 Binary files /dev/null and b/images/ranks/Silver-3.png differ diff --git a/images/ranks/Silver-4.png b/images/ranks/Silver-4.png new file mode 100644 index 0000000..e04e56f Binary files /dev/null and b/images/ranks/Silver-4.png differ diff --git a/images/ranks/Silver-5.png b/images/ranks/Silver-5.png new file mode 100644 index 0000000..23d7479 Binary files /dev/null and b/images/ranks/Silver-5.png differ diff --git a/images/ranks/Unranked.png b/images/ranks/Unranked.png new file mode 100644 index 0000000..45ed698 Binary files /dev/null and b/images/ranks/Unranked.png differ diff --git a/includes/styles.css b/includes/styles.css index d04679e..189b52a 100644 --- a/includes/styles.css +++ b/includes/styles.css @@ -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); diff --git a/index.php b/index.php index d86ca4c..e4b2adc 100644 --- a/index.php +++ b/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 "
| Attribute | Value | ||
|---|---|---|---|
| Attribute | Value | Rank(FPP SQUAD) | Points |
| name | " . htmlspecialchars($value) . " | ||
| name | " . htmlspecialchars($value) . " | " . $rankPoint . " | |
| name | " . htmlspecialchars($value) . " | ![]() | |
| " . htmlspecialchars($key) . " | " . htmlspecialchars($value) . " |
No clan attributes available
"; } + } else { echo "Clan info file missing
"; } diff --git a/update/update_clan_members.ps1 b/update/update_clan_members.ps1 index 03bf144..e09890f 100644 --- a/update/update_clan_members.ps1 +++ b/update/update_clan_members.ps1 @@ -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) { @@ -171,4 +171,30 @@ $lifetimestats['updated'] = $formattedString $lifetimestats | convertto-json -Depth 100 | out-file "$scriptroot/../data/player_lifetime_data.json" remove-lock -Stop-Transcript \ No newline at end of file +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" \ No newline at end of file