Skip to content

Commit

Permalink
Test which schools are displaying class years as '25, '26, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
peteb206 authored Jan 13, 2025
1 parent 7f0c523 commit a446004
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
15 changes: 6 additions & 9 deletions cbn_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,17 @@ def env(key: str):
if key_value_tuple[0] == key:
return key_value_tuple[1]

print(f'platform.system() --> "{platform.system()}"')
RUNNING_LOCALLY = env('LOCAL') == '1'
now = datetime.now()

print(platform.system())
RUNNING_LOCALLY = False if platform.system() == 'Linux' else True

# Requests
session = requests.Session()
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest'
}

def get(url: str, headers: dict[str, str] = headers, timeout: int = 60, verify: bool = True, attempt: int = 0):
headers = {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36',
'X-Requested-With': 'XMLHttpRequest'
}

def print_req_result(req: requests.Response):
if not isinstance(req, requests.Response):
print(f' - timed out after {timeout}s')
Expand Down
4 changes: 3 additions & 1 deletion model.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,10 @@ def __parse_table__(self, html: str):
@staticmethod
def format_player_class(string: str):
# Output Freshman, Sophomore, Junior or Senior
grad_year_map = {"'23": "Senior", "'24": "Junior", "'25": "Sophomore", "'26": "Freshman"}
# TODO: don't want to have this hardcoded. See how many schools are doing this
grad_year_map = {"'25": "Senior", "'26": "Junior", "'27": "Sophomore", "'28": "Freshman"}
if string in grad_year_map.keys():
print('CHECK!')
return grad_year_map[string]

if ('j' in string) | ('3' in string):
Expand Down

0 comments on commit a446004

Please sign in to comment.