Skip to content

Commit

Permalink
Merge pull request #26 from Nullifiers/language-support
Browse files Browse the repository at this point in the history
add language to readme
  • Loading branch information
rajatgoyal715 authored Oct 5, 2019
2 parents 1a7225d + 30a4474 commit dcb6bdd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions hsc/crawler.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ class Crawler():
domain_url = base_url + 'domains/{}/{}'
problem_url = base_url + 'challenges/{}/problem'

new_readme_text = '## [{}]({})\n\n|Problem Name|Problem Link|Solution Link|\n|---|---|---|\n'
new_readme_text = '## [{}]({})\n\n|Problem Name|Problem Link|Language|Solution Link|\n---|---|---|---\n'
readme_headers_len = len(new_readme_text.split('\n'))
problem_readme_text = '|{}|[Problem]({})|[Solution](./{})|\n'
problem_readme_text = '|{}|[Problem]({})|{}|[Solution](./{})|\n'

base_folder_name = 'Hackerrank'

Expand Down Expand Up @@ -75,6 +75,7 @@ class Crawler():

def __init__(self):
self.session = requests.Session()
self.total_submissions = 0

def login(self, username, password):
resp = self.session.get(self.login_url, auth=(username, password))
Expand Down Expand Up @@ -182,7 +183,7 @@ def get_submissions(self, submissions):
if not os.path.exists(readme_file_path):
self.create_readme(track_folder_name, track_url, readme_file_path)
problem_url = self.problem_url.format(challenge_slug)
readme_text = self.problem_readme_text.format(challenge_name, problem_url, file_name + file_extension)
readme_text = self.problem_readme_text.format(challenge_name, problem_url, language, file_name + file_extension)
self.update_readme(
readme_file_path,
readme_text,
Expand Down

0 comments on commit dcb6bdd

Please sign in to comment.