Merge pull request #11 from OpzekerIT/testps1

testps1
This commit is contained in:
OpzekerIT 2023-09-21 10:23:08 +02:00 committed by GitHub
commit c69fa48712

23
ps1/test.ps1 Normal file
View file

@ -0,0 +1,23 @@

$playername = 'Lanta01'
$headers = @{
'accept' = 'application/vnd.api+json'
'Authorization' = 'YOURAPIKEY'
}
$playerinfo = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/players?filter[playerNames]=$playername" -Method GET -Headers $headers
$playedid = $playerinfo.data.id
$seasons = Invoke-RestMethod -Uri 'https://api.pubg.com/shards/steam/seasons' -Method GET -Headers $headers
$season = ($seasons.data | Where-Object { $_.attributes.isCurrentSeason -eq $true }).id
$match_array = @()
$seasonstats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/players/$playedid/seasons/$season`?filter[gamepad]=false" -Method GET -Headers $headers
$pubgmatches = $seasonstats.data.relationships.matchesSquad.data.id
foreach ($match in $pubgmatches) {
Write-Output "checking $Match"
$match_array += Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/matches/$Match" -Method GET -Headers $headers
}