cleanup
This commit is contained in:
parent
c537708cc3
commit
c12be55e35
1 changed files with 4 additions and 13 deletions
|
|
@ -72,12 +72,11 @@ $playermodes = @(
|
||||||
)
|
)
|
||||||
# Initialize the master hashtable
|
# Initialize the master hashtable
|
||||||
$lifetimestats = @{}
|
$lifetimestats = @{}
|
||||||
$webrequestlimiter = 0
|
|
||||||
foreach ($playmode in $playermodes) {
|
foreach ($playmode in $playermodes) {
|
||||||
# Fetch stats for the current playmode
|
# Fetch stats for the current playmode
|
||||||
if ($webrequestlimiter -le 8) {
|
|
||||||
write-output "Getting data for players $playeridstring gameode $playmode"
|
|
||||||
|
|
||||||
|
write-output "Getting data for players $playeridstring gameode $playmode"
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/seasons/lifetime/gameMode/$playmode/players?filter[playerIds]=$playeridstring" -Method GET -Headers $headers
|
$stats = Invoke-RestMethod -Uri "https://api.pubg.com/shards/steam/seasons/lifetime/gameMode/$playmode/players?filter[playerIds]=$playeridstring" -Method GET -Headers $headers
|
||||||
|
|
@ -88,14 +87,6 @@ foreach ($playmode in $playermodes) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$webrequestlimiter++
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
write-ouput "sleeping for 60 seconds"
|
|
||||||
$webrequestlimiter = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Check if the playmode doesn't exist in the hashtable, then add it
|
# Check if the playmode doesn't exist in the hashtable, then add it
|
||||||
if (-not $lifetimestats.ContainsKey($playmode)) {
|
if (-not $lifetimestats.ContainsKey($playmode)) {
|
||||||
$lifetimestats[$playmode] = @{}
|
$lifetimestats[$playmode] = @{}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue