feat(codechef): implement full CodeChef support (#354)
## Problem CodeChef had no working login, submit, or contest list. The browser selectors were wrong, the contest list was missing present/past contests, and problem/contest URLs were unset. ## Solution Fix login and submit selectors for the Drupal-based site. Paginate `/api/list/contests/past` to collect all 228 Starters, then expand each parent contest into individual division entries (e.g. `START228 (Div. 4)`). Add language IDs, correct `url`/`contest_url`/`standings_url` in metadata, and make `:CP <platform>` open the contest picker directly.
This commit is contained in:
parent
c7f2af16d4
commit
3c11d609f5
26 changed files with 336 additions and 158 deletions
|
|
@ -221,6 +221,9 @@ def run_scraper_offline(fixture_text):
|
|||
if "/api/list/contests/all" in url:
|
||||
data = json.loads(fixture_text("codechef/contests.json"))
|
||||
return MockResponse(data)
|
||||
if "/api/list/contests/past" in url:
|
||||
data = json.loads(fixture_text("codechef/contests_past.json"))
|
||||
return MockResponse(data)
|
||||
if "/api/contests/START" in url and "/problems/" not in url:
|
||||
contest_id = url.rstrip("/").split("/")[-1]
|
||||
try:
|
||||
|
|
|
|||
16
tests/fixtures/codechef/contests_past.json
vendored
Normal file
16
tests/fixtures/codechef/contests_past.json
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"status": "success",
|
||||
"message": "past contests list",
|
||||
"contests": [
|
||||
{
|
||||
"contest_code": "START209D",
|
||||
"contest_name": "Starters 209 Div 4",
|
||||
"contest_start_date_iso": "2025-01-01T10:30:00+05:30"
|
||||
},
|
||||
{
|
||||
"contest_code": "START208",
|
||||
"contest_name": "Starters 208",
|
||||
"contest_start_date_iso": "2024-12-25T10:30:00+05:30"
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue