Skip to content

Commit

Permalink
Use python trending repo, fix CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
Imafikus committed Oct 9, 2021
1 parent 911fef3 commit 4671b2a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions backend/comment_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def get_all_choosen_comments() -> List[ChoosenComment]:
file_content = github_api.get_raw_data(f.download_url)
chosen_comments += extract_python_comments(file_content, f.html_url)

logging.info(f'Current number of comments: {len(chosen_comments)}')

if len(chosen_comments) >= MAX_COMMENT_NUMBER:
break
return chosen_comments
Expand Down
2 changes: 1 addition & 1 deletion backend/github_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ def get_raw_data(url: str):
return data.text

def get_trending_page():
data = _make_get_request('https://github.com/trending?spoken_language_code=en')
data = _make_get_request('https://github.com/trending/python?since=daily&spoken_language_code=en') #TODO: Fix this when more than 1 language is supported
return data.text
2 changes: 1 addition & 1 deletion backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

origins = [
'http://localhost:3000',
'https://random-github-production-frontend-spsikwsyha-ew.a.run.app'
'https://randomgh.neting.cc'
]

app = FastAPI()
Expand Down

0 comments on commit 4671b2a

Please sign in to comment.