{"action":"created","comment":{"url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/comments/51221325","id":51221325,"diff_hunk":"@@ -8,90 +8,77 @@\n import html2text as h2t\n from logging import warning, info\n from httplib import HTTPException\n-from google.appengine.api import urlfetch\n from google.appengine.runtime.apiproxy_errors import DeadlineExceededError\n from lxml import etree\n \n \n-class codeforcesAPI(object):\n-    API_URL = \"http://codeforces.com/api\"\n-\n-    # Returns all problems of specific contest contest_problems\n-    def contest_problems(self, **kwargs):\n-        kwargs[\"from\"] = 1\n-        kwargs[\"count\"] = 1\n-        kwargs[\"showUnofficial\"] = True\n-        result = self.__make_request(\"contest.standings\", **kwargs)\n-        return result[\"problems\"]\n-\n-    # Returns all problems from problemset\n-    def problemset_problems(self):\n-        result = self.__make_request(\"problemset.problems\", deadline=60)\n-        return result[\"problems\"]\n-\n-    # Returns all contests\n-    def contest_list(self):\n-        return self.__make_request(\"contest.list\", deadline=60)\n-\n-    # Returns ratings change object\n-    def user_rating(self, **kwargs):\n-        return self.__make_request(\"user.rating\", **kwargs)\n-\n-    #  Returns all users from mongolia\n-    def codeforces_ratings(self, **kwargs):\n-        users = self.__make_request(\"user.ratedList\", deadline=240, **kwargs)\n-\n-        result = []\n-        now = time.time()\n-        six_month = 6 * 30 * 24 * 60 * 60\n-        for user in users:\n-            # If user is from Mongolia\n-            if (\"country\" in user and user[\"country\"] == \"Mongolia\"):\n-                # All participated contests array\n-                for i in range(3):\n-                    try:\n-                        ratings = self.user_rating(handle=user[\"handle\"])\n-                        break\n-                    except DeadlineExceededError:\n-                        warning(\"Failed fetching user: %s\" % user[\"handle\"])\n-                else:\n-                    warning(\"Skipping user: %s ( Timeout )\" % user[\"handle\"])\n-\n-                # Skip if not competed in contest\n-                if not ratings:\n-                    info(\"Skipping user: %s ( Not ranked )\" % user[\"handle\"])\n-                    continue\n-\n-                # Skip if not active in last 180 day\n-                last_contest = ratings[-1]\n-                diff = now - last_contest[\"ratingUpdateTimeSeconds\"]\n-                if diff > six_month:\n-                    info(\"Skipping user: %s ( Not active )\" % user[\"handle\"])\n-                    continue\n-\n-                # Populate with change and contest_id from last_contest\n-                user[\"change\"] = last_contest[\"newRating\"] - \\\n-                    last_contest[\"oldRating\"]\n-                user[\"contest_id\"] = last_contest[\"contestId\"]\n-\n-                result.append(user)\n-\n-        return result\n-\n-    def __make_url(self, methodName, **kwargs):\n-        return self.API_URL + \"/\" + methodName + \\\n-            \"?\" + urllib.urlencode(kwargs.items())\n-\n-    def __make_request(self, methodName, deadline=None, **kwargs):\n-        URL = self.__make_url(methodName, **kwargs)\n-\n-        info(\"Request : \" + URL)\n-        r = urlfetch.fetch(URL, deadline=deadline)\n-        result = json.loads(r.content)\n-\n-        if (result[\"status\"] == \"FAILED\"):\n-            raise Exception(\"Request failed\")\n-        return result[\"result\"]\n+# Returns all problems from problemset\n+def problemset_problems():\n+    result = cf_api(\"problemset.problems\")\n+    return result[\"problems\"]\n+\n+\n+# Returns all problems of specific contest contest_problems\n+def contest_problems(contestId):\n+    result = cf_api(\"contest.standings\", **{\n+        \"from\": 1,\n+        \"count\": 1,\n+        \"contestId\": contestId,\n+    })\n+    return result[\"problems\"]\n+\n+\n+# Codeforces users from mongolia\n+def codeforces_ratings():","path":"parse.py","position":105,"original_position":105,"commit_id":"c762532acf29e3b2ac1b72ac54f9524480f36fac","original_commit_id":"c762532acf29e3b2ac1b72ac54f9524480f36fac","user":{"login":"amarbattulga","id":12068641,"avatar_url":"https://avatars.githubusercontent.com/u/12068641?v=3","gravatar_id":"","url":"https://api.github.com/users/amarbattulga","html_url":"https://github.com/amarbattulga","followers_url":"https://api.github.com/users/amarbattulga/followers","following_url":"https://api.github.com/users/amarbattulga/following{/other_user}","gists_url":"https://api.github.com/users/amarbattulga/gists{/gist_id}","starred_url":"https://api.github.com/users/amarbattulga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarbattulga/subscriptions","organizations_url":"https://api.github.com/users/amarbattulga/orgs","repos_url":"https://api.github.com/users/amarbattulga/repos","events_url":"https://api.github.com/users/amarbattulga/events{/privacy}","received_events_url":"https://api.github.com/users/amarbattulga/received_events","type":"User","site_admin":false},"body":"codeforces API-с хэрэглэчидийн мэдээлэл татахаар timeout болоод Codeforces-н чансаа шинэчлэгдэхгүй байсныг засав ( ер нь 60с дээш секунд юм татуулдаггүй юм байна ) local дээр зүгээр байгаад байдаг AppEngine дээрээ очоод тэгдэг болтой юм байна ( StackoverFlow, Google-н forum-с олж мэдэв )","created_at":"2016-01-29T03:06:38Z","updated_at":"2016-01-29T03:06:38Z","html_url":"https://github.com/gmunkhbaatarmn/codeforces-mn/pull/35#discussion_r51221325","pull_request_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35","_links":{"self":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/comments/51221325"},"html":{"href":"https://github.com/gmunkhbaatarmn/codeforces-mn/pull/35#discussion_r51221325"},"pull_request":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35"}}},"pull_request":{"url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35","id":57598512,"html_url":"https://github.com/gmunkhbaatarmn/codeforces-mn/pull/35","diff_url":"https://github.com/gmunkhbaatarmn/codeforces-mn/pull/35.diff","patch_url":"https://github.com/gmunkhbaatarmn/codeforces-mn/pull/35.patch","issue_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues/35","number":35,"state":"open","locked":false,"title":"Two upcoming contest widged into one","user":{"login":"amarbattulga","id":12068641,"avatar_url":"https://avatars.githubusercontent.com/u/12068641?v=3","gravatar_id":"","url":"https://api.github.com/users/amarbattulga","html_url":"https://github.com/amarbattulga","followers_url":"https://api.github.com/users/amarbattulga/followers","following_url":"https://api.github.com/users/amarbattulga/following{/other_user}","gists_url":"https://api.github.com/users/amarbattulga/gists{/gist_id}","starred_url":"https://api.github.com/users/amarbattulga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarbattulga/subscriptions","organizations_url":"https://api.github.com/users/amarbattulga/orgs","repos_url":"https://api.github.com/users/amarbattulga/repos","events_url":"https://api.github.com/users/amarbattulga/events{/privacy}","received_events_url":"https://api.github.com/users/amarbattulga/received_events","type":"User","site_admin":false},"body":"1. Topcoder, codeforces тэмцээнүүдийн 2 widget нийлүүлэв\r\n2. Чансааг харуулах функцийг өөрчлөв\r\n3. codeforcesAPI class-г бүр мөсөн байхгүй болгов","created_at":"2016-01-29T02:30:50Z","updated_at":"2016-01-29T03:06:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a7c0946a6efee0e4a7452654c12699029c2f5795","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35/commits","review_comments_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35/comments","review_comment_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues/35/comments","statuses_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/statuses/c762532acf29e3b2ac1b72ac54f9524480f36fac","head":{"label":"amarbattulga:master","ref":"master","sha":"c762532acf29e3b2ac1b72ac54f9524480f36fac","user":{"login":"amarbattulga","id":12068641,"avatar_url":"https://avatars.githubusercontent.com/u/12068641?v=3","gravatar_id":"","url":"https://api.github.com/users/amarbattulga","html_url":"https://github.com/amarbattulga","followers_url":"https://api.github.com/users/amarbattulga/followers","following_url":"https://api.github.com/users/amarbattulga/following{/other_user}","gists_url":"https://api.github.com/users/amarbattulga/gists{/gist_id}","starred_url":"https://api.github.com/users/amarbattulga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarbattulga/subscriptions","organizations_url":"https://api.github.com/users/amarbattulga/orgs","repos_url":"https://api.github.com/users/amarbattulga/repos","events_url":"https://api.github.com/users/amarbattulga/events{/privacy}","received_events_url":"https://api.github.com/users/amarbattulga/received_events","type":"User","site_admin":false},"repo":{"id":48640079,"name":"codeforces-mn","full_name":"amarbattulga/codeforces-mn","owner":{"login":"amarbattulga","id":12068641,"avatar_url":"https://avatars.githubusercontent.com/u/12068641?v=3","gravatar_id":"","url":"https://api.github.com/users/amarbattulga","html_url":"https://github.com/amarbattulga","followers_url":"https://api.github.com/users/amarbattulga/followers","following_url":"https://api.github.com/users/amarbattulga/following{/other_user}","gists_url":"https://api.github.com/users/amarbattulga/gists{/gist_id}","starred_url":"https://api.github.com/users/amarbattulga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amarbattulga/subscriptions","organizations_url":"https://api.github.com/users/amarbattulga/orgs","repos_url":"https://api.github.com/users/amarbattulga/repos","events_url":"https://api.github.com/users/amarbattulga/events{/privacy}","received_events_url":"https://api.github.com/users/amarbattulga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/amarbattulga/codeforces-mn","description":"Codeforces.mn - Localization of Codeforces.com","fork":true,"url":"https://api.github.com/repos/amarbattulga/codeforces-mn","forks_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/forks","keys_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/teams","hooks_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/hooks","issue_events_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/issues/events{/number}","events_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/events","assignees_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/assignees{/user}","branches_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/branches{/branch}","tags_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/tags","blobs_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/git/refs{/sha}","trees_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/statuses/{sha}","languages_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/languages","stargazers_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/stargazers","contributors_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/contributors","subscribers_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/subscribers","subscription_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/subscription","commits_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/commits{/sha}","git_commits_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/git/commits{/sha}","comments_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/comments{/number}","issue_comment_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/issues/comments{/number}","contents_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/contents/{+path}","compare_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/merges","archive_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/downloads","issues_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/issues{/number}","pulls_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/pulls{/number}","milestones_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/milestones{/number}","notifications_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/labels{/name}","releases_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/releases{/id}","deployments_url":"https://api.github.com/repos/amarbattulga/codeforces-mn/deployments","created_at":"2015-12-27T09:41:27Z","updated_at":"2016-01-25T16:13:14Z","pushed_at":"2016-01-29T02:26:55Z","git_url":"git://github.com/amarbattulga/codeforces-mn.git","ssh_url":"git@github.com:amarbattulga/codeforces-mn.git","clone_url":"https://github.com/amarbattulga/codeforces-mn.git","svn_url":"https://github.com/amarbattulga/codeforces-mn","homepage":"","size":2816,"stargazers_count":0,"watchers_count":0,"language":"Tcl","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"gmunkhbaatarmn:master","ref":"master","sha":"ae28dab68cb00258344d0cf160682a8b2f2858ba","user":{"login":"gmunkhbaatarmn","id":67686,"avatar_url":"https://avatars.githubusercontent.com/u/67686?v=3","gravatar_id":"","url":"https://api.github.com/users/gmunkhbaatarmn","html_url":"https://github.com/gmunkhbaatarmn","followers_url":"https://api.github.com/users/gmunkhbaatarmn/followers","following_url":"https://api.github.com/users/gmunkhbaatarmn/following{/other_user}","gists_url":"https://api.github.com/users/gmunkhbaatarmn/gists{/gist_id}","starred_url":"https://api.github.com/users/gmunkhbaatarmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmunkhbaatarmn/subscriptions","organizations_url":"https://api.github.com/users/gmunkhbaatarmn/orgs","repos_url":"https://api.github.com/users/gmunkhbaatarmn/repos","events_url":"https://api.github.com/users/gmunkhbaatarmn/events{/privacy}","received_events_url":"https://api.github.com/users/gmunkhbaatarmn/received_events","type":"User","site_admin":false},"repo":{"id":15047998,"name":"codeforces-mn","full_name":"gmunkhbaatarmn/codeforces-mn","owner":{"login":"gmunkhbaatarmn","id":67686,"avatar_url":"https://avatars.githubusercontent.com/u/67686?v=3","gravatar_id":"","url":"https://api.github.com/users/gmunkhbaatarmn","html_url":"https://github.com/gmunkhbaatarmn","followers_url":"https://api.github.com/users/gmunkhbaatarmn/followers","following_url":"https://api.github.com/users/gmunkhbaatarmn/following{/other_user}","gists_url":"https://api.github.com/users/gmunkhbaatarmn/gists{/gist_id}","starred_url":"https://api.github.com/users/gmunkhbaatarmn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gmunkhbaatarmn/subscriptions","organizations_url":"https://api.github.com/users/gmunkhbaatarmn/orgs","repos_url":"https://api.github.com/users/gmunkhbaatarmn/repos","events_url":"https://api.github.com/users/gmunkhbaatarmn/events{/privacy}","received_events_url":"https://api.github.com/users/gmunkhbaatarmn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gmunkhbaatarmn/codeforces-mn","description":"Codeforces.mn - Localization of Codeforces.com","fork":false,"url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn","forks_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/forks","keys_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/teams","hooks_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/hooks","issue_events_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues/events{/number}","events_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/events","assignees_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/assignees{/user}","branches_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/branches{/branch}","tags_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/tags","blobs_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/git/refs{/sha}","trees_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/statuses/{sha}","languages_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/languages","stargazers_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/stargazers","contributors_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/contributors","subscribers_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/subscribers","subscription_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/subscription","commits_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/commits{/sha}","git_commits_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/git/commits{/sha}","comments_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/comments{/number}","issue_comment_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues/comments{/number}","contents_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/contents/{+path}","compare_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/merges","archive_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/downloads","issues_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues{/number}","pulls_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls{/number}","milestones_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/milestones{/number}","notifications_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/labels{/name}","releases_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/releases{/id}","deployments_url":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/deployments","created_at":"2013-12-09T13:30:16Z","updated_at":"2016-01-13T10:46:37Z","pushed_at":"2016-01-29T02:30:50Z","git_url":"git://github.com/gmunkhbaatarmn/codeforces-mn.git","ssh_url":"git@github.com:gmunkhbaatarmn/codeforces-mn.git","clone_url":"https://github.com/gmunkhbaatarmn/codeforces-mn.git","svn_url":"https://github.com/gmunkhbaatarmn/codeforces-mn","homepage":"","size":2843,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":8,"mirror_url":null,"open_issues_count":5,"forks":8,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35"},"html":{"href":"https://github.com/gmunkhbaatarmn/codeforces-mn/pull/35"},"issue":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues/35"},"comments":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/gmunkhbaatarmn/codeforces-mn/statuses/c762532acf29e3b2ac1b72ac54f9524480f36fac"}}}}