Skip to content

Commit

Permalink
adjust to new layout
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Dec 13, 2023
1 parent ca3ec68 commit eabe5f7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions update_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,8 @@
soup = BeautifulSoup(html.content, "html.parser")
title = soup.find("h1").text
metas = soup.find("div", class_="metadata-difficulty-card")
difficulty = metas.text[: -len("Difficulty")]
if "-" not in difficulty:
score, level = difficulty[:3], difficulty[3:]
else:
score, level = difficulty[6:9], difficulty[9:]
difficulty = metas.text.replace("Difficulty", "-").split("-")
score, level = difficulty[-2], difficulty[-1]
cache[name] = (title, score, level)

total = len(solutions)
Expand Down Expand Up @@ -199,7 +196,7 @@
- toc
---
# {len(solutions)} Problems, {sum(len(v) for v in solutions.values())} Solutions, {len(language_map)} languages
# {len(solutions)} Problems, {sum(len(v) for v in solutions.values())} Solutions, {len(language_map)} Languages
"""
for name, languages in tqdm(sorted(solutions.items()), desc="📖 Refreshing Docs"):
url = f"https://open.kattis.com/problems/{name}"
Expand Down

0 comments on commit eabe5f7

Please sign in to comment.