Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iterate through organization repos #15

Open
whoot opened this issue Jan 31, 2020 · 0 comments
Open

Iterate through organization repos #15

whoot opened this issue Jan 31, 2020 · 0 comments

Comments

@whoot
Copy link

whoot commented Jan 31, 2020

Instead of getting just the organization members, it would be better to request the repos of the organization and iterate through every repository. This way you wont get just the member, but also every repo and contributor.

Something like this should do it:

def findUsersFromOrganization(username):
	response = get('https://api.github.com/orgs/%s/repos?per_page=100' % username, auth=HTTPBasicAuth(uname, '')).text
	repositories = re.findall(r'"full_name":"(.*?)"', response)
	print ('%s Total repositories: %s%i%s' % (info, green, len(repositories), end))
	for repo in repositories:
		print ('\n%s Checking %s%s%s' % (info, green, repo, end))
		org = repo.split('/')[0]
		repository = repo.split('/')[1]
		findEmailsFromRepo(org, repository)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant