@@ -39,7 +39,7 @@ async def request_past_contests(
39
39
past_contests .extend (
40
40
response .json ().get ("data" , {}).get ("pastContests" , {}).get ("data" , [])
41
41
)
42
- logger .success ( "finished " )
42
+ logger .info ( f" { max_page_num = } { len ( past_contests ) = } " )
43
43
return past_contests
44
44
45
45
@@ -57,7 +57,7 @@ async def request_contest_homepage_text():
57
57
return req .text
58
58
59
59
60
- async def save_next_two_contests () -> List [Dict ]:
60
+ async def request_next_two_contests () -> List [Dict ]:
61
61
"""
62
62
save two coming contests
63
63
:return:
@@ -95,7 +95,7 @@ async def save_next_two_contests() -> List[Dict]:
95
95
return top_two_contests
96
96
97
97
98
- async def save_all_past_contests () -> List [Dict ]:
98
+ async def request_all_past_contests () -> List [Dict ]:
99
99
"""
100
100
Save past contests
101
101
:return:
@@ -109,13 +109,15 @@ async def save_all_past_contests() -> List[Dict]:
109
109
logger .error ("cannot find pageNum" )
110
110
return []
111
111
max_page_num = int (max_page_num_search .groups ()[0 ])
112
- return await request_past_contests (max_page_num )
112
+ all_past_contests = await request_past_contests (max_page_num )
113
+ return all_past_contests
113
114
114
115
115
- async def save_recent_contests () -> List [Dict ]:
116
+ async def request_recent_contests () -> List [Dict ]:
116
117
"""
117
118
Save 10 past contests on the first page
118
119
:return:
119
120
"""
121
+ # 10 contests on the first page, which are enough
120
122
ten_past_contests = await request_past_contests (1 )
121
123
return ten_past_contests
0 commit comments