Merge pull request #163 from OpzekerIT/main

terug
This commit is contained in:
Lanta 2023-11-28 22:47:03 +01:00 committed by GitHub
commit 868289f316
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,8 +33,6 @@ catch {
Write-Output 'Unable to read file exitin' Write-Output 'Unable to read file exitin'
exit exit
} }
foreach ($player in $player_data) { foreach ($player in $player_data) {
$lastMatches = $player.relationships.matches.data.id #| Select-Object -First 10 $lastMatches = $player.relationships.matches.data.id #| Select-Object -First 10
$playermatches = @() $playermatches = @()
@ -46,7 +44,7 @@ foreach ($player in $player_data) {
} }
else { else {
$stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$match" -Method GET -Headers $headers $stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$match" -Method GET -Headers $headers
$sortedStats = $stats.included | Where-Object { $_.attributes.stats } | Sort-Object { $_.attributes.stats.winplace } $sortedStats = $stats.included | Sort-Object { $_.attributes.stats.winplace }
$stats.included = $sortedStats $stats.included = $sortedStats
$stats | ConvertTo-Json -Depth 100 | Out-File "$scriptroot/../data/matches/$match.json" $stats | ConvertTo-Json -Depth 100 | Out-File "$scriptroot/../data/matches/$match.json"
} }