| import urllib.request, json, sys | |
| def list_repo(owner, repo): | |
| url = f'https://api.github.com/repos/{owner}/{repo}/git/trees/main?recursive=1' | |
| try: | |
| with urllib.request.urlopen(url) as resp: | |
| data = json.loads(resp.read().decode()) | |
| for item in data.get('tree', []): | |
| print(item['path']) | |
| except Exception as e: | |
| print(f'Error: {e}') | |
| list_repo('ticketguy', 'littlefig') | |
| print('---LILA---') | |
| list_repo('ticketguy', 'Lila') | |
| print('---EMBERS---') | |
| list_repo('ticketguy', 'embers-diaries') | |