we can skip some of the calls for tourneys we're already skipping
This commit is contained in:
parent
cdfe43a125
commit
392dc33817
@ -31,6 +31,12 @@ while ( true ) {
|
||||
$tournaments = json_decode( $body );
|
||||
|
||||
foreach ( $tournaments->data as $tournament ) {
|
||||
// skip finals
|
||||
if ( $tournament->linkedTournamentId === null ) {
|
||||
continue;
|
||||
}
|
||||
echo PHP_EOL . $tournament->name . PHP_EOL;
|
||||
|
||||
$tournamentDetails = $client->get( "tournaments/{$tournament->tournamentId}", [
|
||||
'query' => [
|
||||
'includePlayers' => '1',
|
||||
@ -39,14 +45,12 @@ while ( true ) {
|
||||
] )->getBody();
|
||||
$details = json_decode( $tournamentDetails );
|
||||
|
||||
// skip finals
|
||||
if ( $details->data->linkedTournamentId === null ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
echo $details->data->name;
|
||||
$playerCount = count( $details->data->players );
|
||||
echo $playerCount;
|
||||
echo $playerCount . PHP_EOL;
|
||||
|
||||
if (!isset($playerCounts[$details->data->location->name]))
|
||||
$playerCounts[$details->data->location->name] = 0;
|
||||
|
||||
$playerCounts[ $details->data->location->name ] += $playerCount;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user