Skip to content

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

torquecoder
Copy link

@torquecoder torquecoder commented Jun 27, 2017

Adding feature of issue #164
Some of the sample queries are:

  • upcoming cp contests
  • programming contests
  • cp contest
  • competitive programming contests

@torquecoder
Copy link
Author

Any update?

@@ -4,6 +4,7 @@
'book',
'bye',
'coin',
'cpcontest',
Copy link
Owner

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.

Copy link
Author

@torquecoder torquecoder Jun 28, 2017

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/')
Copy link
Owner

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.)?

Copy link
Author

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
Copy link
Owner

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.

r = requests.get('https://cpcontest-api.herokuapp.com/')
data = r.json()

template = GenericTemplate()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused?

@@ -0,0 +1,30 @@
import requests
import os

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()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F821 undefined name 'ButtonTemplate'

@@ -0,0 +1,6 @@
import modules

def test_cpcontest():

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

@horrormyth
Copy link

@torquecoder Let's fix the tests please, one of the tests is failing, :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants