-
Notifications
You must be signed in to change notification settings - Fork 1
Fix/user feedback #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8e1bb98
Fix feedback bug and add features.
saihtaungkham 46bf6f6
Fix ambiguous youtube query order keyword.
saihtaungkham 9abf08f
Add usage to README file.
saihtaungkham 569a8dc
Fix YouTube response result and Exceptions.
saihtaungkham 9c52cf5
Check Auth Error on YouTube before happening.
saihtaungkham e0270f4
Fix YouTube response result and Exceptions.
saihtaungkham File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,46 @@ | ||
import os | ||
|
||
|
||
class Config(object): | ||
"""Class for API Request configuration.""" | ||
|
||
# Paper with code configuration | ||
PWC_USER_NAME = os.environ.get('PWC_USER_NAME') or '' | ||
PWC_PASSWORD = os.environ.get('PWC_PASSWORD') or '' | ||
PWC_URL = os.environ.get('PWC_URL') or "https://paperswithcode.com/api/v0/search/?q=" | ||
PWC_USER_NAME = os.environ.get("PWC_USER_NAME") or "" | ||
PWC_PASSWORD = os.environ.get("PWC_PASSWORD") or "" | ||
PWC_URL = ( | ||
os.environ.get("PWC_URL") or "https://paperswithcode.com/api/v0/search/?q=" | ||
) | ||
|
||
# Github configuration | ||
GITHUB_ACC_TOKEN = os.environ.get('GITHUB_ACC_TOKEN') or None | ||
GITHUB_URL = os.environ.get('GITHUB_URL') or "in:readme+in:description" | ||
GITHUB_ACC_TOKEN = os.environ.get("GITHUB_ACC_TOKEN") or None | ||
GITHUB_URL = os.environ.get("GITHUB_URL") or "in:readme+in:description" | ||
|
||
# AIP Source | ||
VALID_API_SOURCE = ['paperwithcode', 'github', 'coursera', 'youtube'] | ||
VALID_API_SOURCE = ["paperwithcode", "github", "coursera", "youtube"] | ||
|
||
# Youtube configuration | ||
YOUTUBE_SERVICE_NAME = os.environ.get('YOUTUBE_SERVICE_NAME') or "youtube" | ||
YOUTUBE_API_VERSION = os.environ.get('YOUTUBE_API_VERSION') or "v3" | ||
YOUTUBE_DEVELOPER_KEY = os.environ.get('YOUTUBE_DEVELOPER_KEY') or None | ||
YOUTUBE_ORDER = os.environ.get('YOUTUBE_ORDER') or "relevance" | ||
YOUTUBE_SAFESEARCH = os.environ.get('YOUTUBE_SAFESEARCH') or "strict" | ||
YOUTUBE_PART = os.environ.get('YOUTUBE_PART') or "snippet" | ||
YOUTUBE_SERVICE_NAME = os.environ.get("YOUTUBE_SERVICE_NAME") or "youtube" | ||
YOUTUBE_API_VERSION = os.environ.get("YOUTUBE_API_VERSION") or "v3" | ||
# Parsing Youtube Keys | ||
YOUTUBE_DEVELOPER_KEY = list() | ||
developer_key = os.environ.get("YOUTUBE_DEVELOPER_KEY") | ||
if isinstance(developer_key, list): | ||
YOUTUBE_DEVELOPER_KEY = developer_key | ||
elif isinstance(developer_key, str) and "," in developer_key: | ||
YOUTUBE_DEVELOPER_KEY = developer_key.strip().split(",") | ||
elif developer_key and isinstance(developer_key, str): | ||
YOUTUBE_DEVELOPER_KEY.append(developer_key) | ||
YOUTUBE_ORDER = os.environ.get("YOUTUBE_ORDER") or "relevance" | ||
YOUTUBE_SAFESEARCH = os.environ.get("YOUTUBE_SAFESEARCH") or "strict" | ||
YOUTUBE_PART = os.environ.get("YOUTUBE_PART") or "snippet" | ||
YOUTUBE_FIX_KEYWORD = "machine learning" | ||
YOUTUBE_QUERY_FILTER = " " + YOUTUBE_FIX_KEYWORD + " -news" | ||
VALID_YOUTUBE_ORDER = [ | ||
"date", | ||
"rating", | ||
"relevance", | ||
"title", | ||
# "videoCount", # This is for channel only | ||
"viewCount", | ||
] | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.