Skip to content

Commit 805cdee

Browse files
committed
docs: rename script folder
1 parent 578f591 commit 805cdee

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed
File renamed without changes.

scripts/config.py script/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from enum import unique, Enum
33

44
cn_graphql_url = 'https://leetcode-cn.com/graphql'
5+
problems_url = 'https://leetcode-cn.com/problems/'
56
all_problems_url = 'https://leetcode.com/api/problems/all/'
67
lcof_problems_url = 'https://leetcode-cn.com/api/problems/lcof/'
78
lcci_problems_url = 'https://leetcode-cn.com/api/problems/lcci/'

scripts/fetch.py script/fetch.py

File renamed without changes.

scripts/leetcode_spider.py script/leetcode_spider.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from urllib.parse import quote
33

44
from config import async_headers, cn_graphql_url, Req, all_problems_url, difficulties, lcof_problems_url, \
5-
lcci_problems_url
5+
lcci_problems_url, problems_url
66
from fetch import fetch
77

88

@@ -41,7 +41,7 @@ def get_all_questions():
4141
for question in questions:
4242
qid = str(question['stat']['question_id']).zfill(4)
4343
title = question['stat']['question__title']
44-
link = 'https://leetcode-cn.com/problems/' + question['stat']['question__title_slug']
44+
link = problems_url + question['stat']['question__title_slug']
4545
git_link = '/solution/{}/README.md'.format(qid + '.' + quote(title))
4646
cn_title = cn_res.get(qid) or title
4747
col1 = '[{}]({})'.format(qid, link)
@@ -61,7 +61,7 @@ def get_lcof_questions():
6161
fe_qid = question['stat']['frontend_question_id']
6262
qno = fe_qid.replace('面试题', '').strip()
6363
title = question['stat']['question__title'].replace(' LCOF', '').strip()
64-
link = 'https://leetcode-cn.com/problems/' + question['stat']['question__title_slug']
64+
link = problems_url + question['stat']['question__title_slug']
6565
git_link = '/lcof/{}/README.md'.format(quote(fe_qid + '. ' + title))
6666
col1 = '[{}]({})'.format(qno, link)
6767
col2 = '[{}]({})'.format(title, git_link)
@@ -82,7 +82,7 @@ def get_lcci_questions():
8282
fe_qid = question['stat']['frontend_question_id']
8383
qno = fe_qid.replace('面试题', '').strip()
8484
cn_title = cn_res.get(str(qid))
85-
link = 'https://leetcode-cn.com/problems/' + question['stat']['question__title_slug']
85+
link = problems_url + question['stat']['question__title_slug']
8686
git_link = '/lcci/{}/README.md'.format(quote(fe_qid + '. ' + cn_title))
8787
col1 = '[{}]({})'.format(qno, link)
8888
col2 = '[{}]({})'.format(cn_title, git_link)
File renamed without changes.

0 commit comments

Comments
 (0)