We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ace5f4b commit be38af9Copy full SHA for be38af9
scripts/ojhtml2markdown.py
@@ -24,17 +24,20 @@ def content(self):
24
25
26
def leet_lint_url(url):
27
- problem_slug = url.strip('/')[-1]
+ problem_slug = url.strip('/').split('/')[-1]
28
leetcode_url = 'https://leetcode.com/problems/{}/'.format(problem_slug)
29
lintcode_url = 'http://www.lintcode.com/en/problem/{}/'.format(problem_slug)
30
urls = {}
31
for url in [leetcode_url, lintcode_url]:
32
response = requests.head(url)
33
- if response.status_code == 200:
+ print(response)
34
+ if response.status_code != 404:
35
if url.startswith('https://leetcode'):
36
urls['leetcode'] = url
37
elif url.startswith('http://www.lintcode'):
38
urls['lintcode'] = url
39
+ else:
40
+ print(url)
41
return urls
42
43
0 commit comments