@@ -25,13 +25,21 @@ def get_data(user_repo):
25
25
commit_times = []
26
26
links = []
27
27
28
+ seen_problems = set () # ์ด๋ฏธ ๋ณธ ๋ฌธ์ ๋ฅผ ์ถ์ ํ set
29
+
28
30
# ํ์ผ ๊ฒฝ๋ก์์ ์ฌ์ดํธ, ๋์ด๋, ๋ฌธ์ ๋ฒํธ/์ด๋ฆ ์ถ์ถ
29
31
for item in response_data :
30
32
path_parts = item ['path' ].split ('/' )
31
33
if len (path_parts ) >= 3 :
32
34
site = path_parts [0 ]
33
35
difficulty = path_parts [1 ]
34
36
problem = path_parts [2 ] # ๋ฌธ์ ์ด๋ฆ ์ ์ฒด(ํ์ฅ์ ํฌํจ) ๊ฐ์ ธ์ค๊ธฐ
37
+ # ์ด๋ฏธ ๋ณธ ๋ฌธ์ ๋ ๊ฑด๋๋
38
+ problem_key = (site , difficulty , problem )
39
+ if problem_key in seen_problems :
40
+ continue # ์ค๋ณต๋ ๋ฌธ์ ๋ ์ถ๊ฐํ์ง ์์
41
+ seen_problems .add (problem_key )
42
+
35
43
sites .append (site )
36
44
difficulties .append (difficulty )
37
45
problems .append (problem )
@@ -46,8 +54,11 @@ def get_data(user_repo):
46
54
else :
47
55
commit_times .append (current_time ) # ์ปค๋ฐ์ด ์์ผ๋ฉด ํ์ฌ ์๊ฐ ์ฌ์ฉ
48
56
49
- # ๊ฐ ๋ฌธ์ ์ ๋ํ ๋งํฌ ์ถ๊ฐ
50
- links .append (f"https://github.com/{ user_repo } /blob/main/{ item ['path' ]} " )
57
+ # README.md ๋งํฌ๋ง ์ถ์ถ
58
+ if "README.md" in item ['path' ]:
59
+ links .add (f"https://github.com/{ user_repo } /blob/main/{ item ['path' ]} " )
60
+ else :
61
+ links .add (f"https://github.com/{ user_repo } /blob/main/{ item ['path' ]} " ) # ๋ค๋ฅธ ํ์ผ์ด ์๋ค๋ฉด ๊ทธ๋๋ก ์ถ๊ฐ
51
62
52
63
return sites , difficulties , problems , commit_times , links
53
64
0 commit comments