Last active
January 22, 2025 19:47
-
-
Save anorth848/686221ca793dd2dc3a5412359d0aa31e to your computer and use it in GitHub Desktop.
Get DartConnect Event matches json response
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 characters
| import requests | |
| import json | |
| import argparse | |
| import pyperclip | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument("--event", help="The dartconnect event id for the event", required=True) | |
| args = parser.parse_args() | |
| url = f'https://tv.dartconnect.com/api2/event/{args.event}/matches' | |
| response = requests.post(url).json() | |
| for i in response['payload']['events']: | |
| if i['bracket_status'] != 'C': | |
| raise ValueError('Bracket is not complete. Close bracket first.') | |
| pyperclip.copy(json.dumps(response, indent=4)) | |
| print(f"Copied matches to clipboard for {response['payload']['events'][0]['event_label']}") |
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 characters
| certifi==2024.12.14 | |
| charset-normalizer==3.4.0 | |
| idna==3.10 | |
| pyperclip==1.9.0 | |
| requests==2.32.3 | |
| urllib3==1.26.6 |
Author
anorth848
commented
Jan 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment