Last active
November 12, 2020 13:42
-
-
Save pascalschulz/5587c2044e028d0c5f8251e4ec05f755 to your computer and use it in GitHub Desktop.
Revisions
-
pascalschulz revised this gist
Nov 12, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -16,7 +16,7 @@ for page in range(1, int(pages) + 1): response = rq.request("GET", "https://github.com{}?page={}".format(organization, str(page))) repositoryUrls.append(re.findall(r"itemprop=\"name codeRepository\".*href=\"" + path + "/(.*)\" class", response.text)) repositoryUrls = list(itertools.chain.from_iterable(repositoryUrls)) repositoryUrls = ["https://github.com" + organization + "/{0}.git".format(repo) for repo in repositoryUrls] -
pascalschulz revised this gist
Aug 21, 2019 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,15 +1,17 @@ import itertools import re import requests as rq # Your Github organization (e.g. /Github) organization = "/<company_name>" response = rq.request("GET", "https://github.com{0}".format(organization)) try: pages = re.search(r"data-total-pages=\"(\d+)\">", response.text).group(1) except: pages = 1 repositoryUrls = [] for page in range(1, int(pages) + 1): -
pascalschulz created this gist
Jul 23, 2019 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ import itertools import re import requests as rq # Your Github organization (e.g. /Github) organization = "/<company_name>" response = rq.request("GET", "https://github.com{0}".format(organization)) pages = re.search(r"data-total-pages=\"(\d+)\">", response.text).group(1) repositoryUrls = [] for page in range(1, int(pages) + 1): response = rq.request("GET", "https://github.com{}?page={}".format(organization, str(page))) repositoryUrls.append(re.findall(r"href=\"" + organization + "/(.*)\" itemprop", response.text)) repositoryUrls = list(itertools.chain.from_iterable(repositoryUrls)) repositoryUrls = ["https://github.com" + organization + "/{0}.git".format(repo) for repo in repositoryUrls] print(repositoryUrls)