-
Notifications
You must be signed in to change notification settings - Fork 986
Upcoming programming contests added #218
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
base: master
Are you sure you want to change the base?
Conversation
Any update? |
@@ -4,6 +4,7 @@ | |||
'book', | |||
'bye', | |||
'coin', | |||
'cpcontest', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's think of a better name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"contest" would be too generalized, other names are too big such as "programmingcontest" or something like that. So, I abbreviated "competitive programming" to "cp" here. Do you have any suggestion?
output = {} | ||
try: | ||
|
||
r = requests.get('https://cpcontest-api.herokuapp.com/') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this your personal api? If yes, do you plan to maintain it (hosting, bug fixes, etc.)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is my personal API and I am maintaining it. If I could find any alternative API, which is very well maintained and serves the purpose, I will update it.
buttons.add_web_url(contest['Name'], contest['url']) | ||
num -= 1 | ||
if num == 0: | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better way to do this would be to specify this number in the API call itself.
modules/src/cpcontest.py
Outdated
r = requests.get('https://cpcontest-api.herokuapp.com/') | ||
data = r.json() | ||
|
||
template = GenericTemplate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused?
modules/src/cpcontest.py
Outdated
@@ -0,0 +1,30 @@ | |||
import requests | |||
import os |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F401 'os' imported but unused
r = requests.get('https://cpcontest-api.herokuapp.com/') | ||
data = r.json() | ||
|
||
buttons = ButtonTemplate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
F821 undefined name 'ButtonTemplate'
modules/tests/test_cpcontest.py
Outdated
@@ -0,0 +1,6 @@ | |||
import modules | |||
|
|||
def test_cpcontest(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
@torquecoder Let's fix the tests please, one of the tests is failing, :) |
Adding feature of issue #164
Some of the sample queries are: