Browse Source

Print repository URLs instead of names

master
JustAnotherArchivist 1 month ago
parent
commit
db3e79b9c9
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      github-list-repos

+ 2
- 2
github-list-repos View File

@@ -28,7 +28,7 @@ for user in users:
page = 1
while True:
for m in re.finditer(r'<a itemprop="name codeRepository"\s(?:[^>]*\s)?data-hovercard-url="/([^/>"]+/[^/>"]+)/hovercard"', r.text):
print(m.group(1))
print(f'https://github.com/{m.group(1)}')
if '<a class="next_page"' not in r.text:
# End of pagination
break
@@ -39,7 +39,7 @@ for user in users:
r = get(f'https://github.com/{user}?tab=repositories')
while True:
for m in re.finditer(r'<a href="/([^/>"]+/[^/>"]+)" itemprop="name codeRepository"(\s[^>]*)?>', r.text):
print(m.group(1))
print(f'https://github.com/{m.group(1)}')
if not (m := re.search(r'<a\s(?:[^>]*\s)?href="https://github\.com/[^/?"]+\?after=([^&]+)&amp;tab=repositories"(?:\s[^>]*)?>', r.text)):
# End of pagination
break


Loading…
Cancel
Save