Toggle navigation
Toggle navigation
This project
Loading...
Sign in
송용우
/
oss-Jaksimsamil
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
JJuOn
2020-08-21 09:48:39 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
30cff40beaebcf413da001a46339674c46c8b281
30cff40b
1 parent
2acb4341
Fix comparison error
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
jaksimsamil-crawler/.gitignore
jaksimsamil-crawler/main.py
jaksimsamil-crawler/.gitignore
View file @
30cff40
jaksimsamil
.
/vscode
.
vscode/
*.csv
...
...
jaksimsamil-crawler/main.py
View file @
30cff40
...
...
@@ -26,6 +26,10 @@ def save(df,path='problems.csv'):
df
.
to_csv
(
path
)
print
(
'Done.'
)
def
load
(
path
=
'problems.csv'
):
problems
=
pd
.
read_csv
(
path
,
index_col
=
0
)
return
problems
def
get_khu_problem_list
():
pageNum
=
1
idx
=
0
...
...
@@ -78,7 +82,7 @@ def get_solvedac_level(problems):
print
(
'Collecting solved.ac level data...:'
,
problemNum
)
result
=
json
.
loads
(
res
.
text
)
for
problem
in
result
[
'result'
][
'problems'
]:
if
problem
[
'id'
]
==
problemNum
:
if
int
(
problem
[
'id'
])
==
int
(
problemNum
)
:
problems
.
loc
[
problems
.
problemNum
==
problemNum
,
'solvedacLevel'
]
=
problem
[
'level'
]
break
if
idx
%
SAVE_EVERY
==
0
:
...
...
@@ -114,7 +118,7 @@ def get_category(problems):
idx
=
0
problemListLen
=
len
(
problemList
)
for
problemNum
in
problems
[
'problemNum'
]
.
values
:
if
idx
<
problemListLen
and
problemList
[
idx
][
'id'
]
==
problemNum
:
if
idx
<
problemListLen
and
int
(
problemList
[
idx
][
'id'
])
==
int
(
problemNum
)
:
category
=
json
.
loads
(
problems
.
loc
[
problems
.
problemNum
==
problemNum
,
'category'
]
.
values
[
0
])
category
.
append
(
tag
[
'full_name_ko'
])
problems
.
loc
[
problems
.
problemNum
==
problemNum
,
'category'
]
=
json
.
dumps
(
category
,
ensure_ascii
=
False
)
...
...
Please
register
or
login
to post a comment