diff --git a/getmemberships.php b/getmemberships.php index debe738..71b393f 100755 --- a/getmemberships.php +++ b/getmemberships.php @@ -9,11 +9,19 @@ $limit = 100; $offset = 0; list($projectsById, $projectsByDomain) = getProjectList($limit, $offset, $client); +writeDomains($projectsByDomain); $userList = getUserList($limit, $offset, $client); $membershipMapping = getUserMemberships($userList, $client); -//print_r($projectsById); -//print_r($projectsByDomain); -//print_r($membershipMapping); +print_r($projectsById); +print_r($membershipMapping); + +function writeDomains($projectsByDomain) { + $domainHandle = fopen('./data/domainmap.csv', 'w'); + foreach ($projectsByDomain as $domain => $identifier) { + fwrite ($domainHandle, "$domain,$identifier\n"); + } + fclose($domainHandle); +} function getProjectList($limit, $offset, $client) { // We'll set a more realistic total user count after the first loop.