Skip to content

Commit 61cdf96

Browse files
committed
feat: renewal
1 parent b932683 commit 61cdf96

File tree

6 files changed

+168
-14
lines changed

6 files changed

+168
-14
lines changed

.github/workflows/auto_update.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Auto Update README
22

33
on:
44
schedule:
5-
- cron: '30 17 * * *'
5+
- cron: '45 16 * * *'
66

77
jobs:
88
build:
@@ -22,7 +22,7 @@ jobs:
2222
- name: Run Scripts
2323
run: |
2424
poetry install -C baekjoon_utils
25-
poetry shell -C baekjoon_utils
25+
source baekjoon_utils/.venv/bin/activate
2626
python baekjoon_utils/baekjoon_utils/main.py --update --pick
2727
- name: Commits
2828
run: |

.gitignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ cython_debug/
359359

360360
### Python Patch ###
361361
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
362-
poetry.toml
362+
# poetry.toml
363363

364364
# ruff
365365
.ruff_cache/
@@ -432,4 +432,4 @@ $RECYCLE.BIN/
432432
# Windows shortcuts
433433
*.lnk
434434

435-
# End of https://www.toptal.com/developers/gitignore/api/vim,macos,visualstudiocode,pycharm+all,python,java,c++,windows,linux
435+
# End of https://www.toptal.com/developers/gitignore/api/vim,macos,visualstudiocode,pycharm+all,python,java,c++,windows,linux

baekjoon_utils/baekjoon_utils/utils.py

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
import ssl
2-
import json
31
import random
42
from datetime import datetime, timezone, UTC, timedelta
53
from typing import Union, Tuple
6-
from urllib import request
74

85

96
def get_problem_url(problem_id: Union[int, str]) -> str:
@@ -31,12 +28,7 @@ def level_to_str(level: int) -> str:
3128

3229

3330
def get_api_result(url, headers):
34-
ssl_context = ssl._create_unverified_context()
35-
36-
req = request.Request(url=url, headers=headers)
37-
response = request.urlopen(req, context=ssl_context)
38-
39-
return json.loads(response.read().decode("utf-8"))
31+
return requests.get(url, headers=headers).json()
4032

4133

4234
def get_today_date():

baekjoon_utils/poetry.lock

+160-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

baekjoon_utils/poetry.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[virtualenvs]
2+
in-project = true

baekjoon_utils/pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ readme = "README.md"
99
python = "^3.12"
1010
pydantic = "^2.7.4"
1111
tqdm = "^4.66.4"
12+
requests = "^2.32.3"
1213

1314

1415
[build-system]

0 commit comments

Comments
 (0)