From 6391c03f5341b9d74f1f39dfc140f245606b264f Mon Sep 17 00:00:00 2001 From: Thijs Stobbelaar Date: Thu, 21 Sep 2023 10:22:19 +0200 Subject: [PATCH] testps1 --- ps1/test.ps1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ps1/test.ps1 diff --git a/ps1/test.ps1 b/ps1/test.ps1 new file mode 100644 index 0000000..542d358 --- /dev/null +++ b/ps1/test.ps1 @@ -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 + +}