Browse Source

Get rid of shell quoting and print name/fullname on separate lines instead

master
JustAnotherArchivist 1 year ago
parent
commit
9c1f803e13
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      github-list-repos

+ 4
- 2
github-list-repos View File

@@ -60,7 +60,8 @@ for user in users:
if not mfullname:
print('Error: could not find name h1', file = sys.stderr)
sys.exit(1)
print(f'{shlex.quote(html.unescape(musername.group(1).strip()))} {shlex.quote(html.unescape(mfullname.group(1).strip()))}')
print(html.unescape(musername.group(1).strip().replace('\n', ' ').replace('\r', ' ')))
print(html.unescape(mfullname.group(1).strip().replace('\n', ' ').replace('\r', ' ')))
r = get(f'https://github.com/orgs/{user}/repositories')
page = 1
while True:
@@ -82,7 +83,8 @@ for user in users:
fullname = html.unescape(m.group(1).strip())
else:
fullname = ''
print(f'{shlex.quote(html.unescape(musername.group(1).strip()))} {shlex.quote(fullname)}')
print(html.unescape(musername.group(1).strip()).replace('\n', ' ').replace('\r', ' '))
print(fullname.replace('\n', ' ').replace('\r', ' '))
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):


Loading…
Cancel
Save