Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- import json
- sites = requests.get('https://icpc.global/cm5-contest-rest/rest/contest/public/South-America-Brazil-First-Phase-2020/sites').json()
- teams = []
- for site in sites:
- print(f"Requesting site {site['name']}")
- teams.extend([{**team, 'site': site} for team in requests.get(f'https://icpc.global/cm5-team/rest/team/table/site/accepted/{site["id"]}', { 'q': 'proj:institution,name', 'page': 1, 'size': 1000 }).json()])
- institutions = set([team['institution'] for team in teams])
- print(f'{len(institutions)} instituições')
- print(f'{len(teams)} times')
- with open('teams.json', 'w') as f:
- json.dump(teams, f)
Add Comment
Please, Sign In to add comment