Skip to content

Commit 011e2be

Browse files
committed
fix: solved ac 관련 기능 주석 처리 #3
github action -> solved ac 서버 접속 불가능에 따른 기능 주석 처리
1 parent 53ef298 commit 011e2be

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

.github/auto_notion_post.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,26 @@
2626
raise Exception("File is not exist")
2727

2828

29-
json_data = get(
30-
f"https://solved.ac/api/v3/problem/show?problemId={problem_num}", headers={"Accept": "application/json"}
31-
).json()
29+
# json_data = get(
30+
# f"https://solved.ac/api/v3/problem/show?problemId={problem_num}", headers={"Accept": "application/json"}
31+
# ).json()
3232

3333

3434
algos = []
35-
for tag in json_data.get("tags"):
36-
for tag_info in tag.get("displayNames"):
37-
if tag_info.get("language") == "ko":
38-
algos.append({"name": tag_info.get("name")})
35+
# for tag in json_data.get("tags"):
36+
# for tag_info in tag.get("displayNames"):
37+
# if tag_info.get("language") == "ko":
38+
# algos.append({"name": tag_info.get("name")})
3939

4040
cores = ["브론즈", "실버", "골드", "플레티넘", "다이아몬드", "루비"]
4141
levels = [1, 5, 4, 3, 2]
42-
N = json_data.get("level")
43-
core = cores[(N - 1) // 5]
44-
level = levels[N % 5]
42+
# N = json_data.get("level")
43+
# core = cores[(N - 1) // 5]
44+
# level = levels[N % 5]
4545

46-
title = f"{problem_num}_{json_data['titleKo']}"
46+
47+
# title = f"{problem_num}_{json_data['titleKo']}"
48+
title = f"{problem_num}_"
4749

4850
kst = timezone("Asia/Seoul")
4951

@@ -55,12 +57,12 @@
5557
new_record = {
5658
"상태": {"type": "select", "select": {"name": "해결"}},
5759
"문제 링크": {"type": "url", "url": f"https://www.acmicpc.net/problem/{problem_num}"},
58-
"단계": {"type": "multi_select", "multi_select": [{"name": f"{core} {level}"}]},
60+
# "단계": {"type": "multi_select", "multi_select": [{"name": f"{core} {level}"}]},
5961
"날짜": {"type": "date", "date": {"start": now_date, "end": None, "time_zone": None}},
6062
"깃헙 링크": {"type": "url", "url": f"https://github.com/{repo}/blob/{branch}/{filename}"},
6163
"사람": {"type": "people", "people": [{"object": "user", "id": getenv("NOTION_SELF_ID")}]},
6264
"출처": {"type": "multi_select", "multi_select": [{"name": "백준"}]},
63-
"알고리즘 분류": {"type": "multi_select", "multi_select": algos},
65+
# "알고리즘 분류": {"type": "multi_select", "multi_select": algos},
6466
"문제명": {
6567
"id": "title",
6668
"type": "title",

0 commit comments

Comments
 (0)