Last active
January 16, 2018 21:49
-
-
Save hereismari/0cdf5467ef7fe0417e4abe9ad7825dfc to your computer and use it in GitHub Desktop.
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
| import json | |
| from urllib2 import Request, urlopen | |
| html = Request('http://codeforces.com/api/problemset.problems') | |
| response = urlopen(html) | |
| x = response.read() | |
| data = json.loads(x) | |
| print len(data['result']['problems']) # dict with data from ~ 3912 problems | |
| html = Request('http://codeforces.com/api/user.ratedList') | |
| response = urlopen(html) | |
| x = response.read() | |
| d = json.loads(x) | |
| print len(d['result']) # list with data from ~ 123418 users | |
| html = Request('http://codeforces.com/api/user.ratedList?activeOnly=true') | |
| response = urlopen(html) | |
| x = response.read() | |
| d = json.loads(x) | |
| print len(d['result']) # list with data from ~ 17141 users that participated in recent contests (last month) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment