{"action":"created","comment":{"url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/comments/54368593","id":54368593,"diff_hunk":"@@ -0,0 +1,114 @@\n+'use strict';\n+\n+const fs = require('fs');\n+const request = require('request');\n+const natural = require('natural');\n+const token = fs.readFileSync('./key.txt', 'utf-8');\n+const ignoreWords = JSON.parse(fs.readFileSync('./ignoreWords.json', 'utf-8')).words;\n+\n+var url = 'https://api.github.com/users/urfu-2015/repos';\n+var repoURL = 'https://api.github.com/repos/urfu-2015/';\n+var accessToken = '?access_token=' + token;\n+\n+exports.top = function (n) {\n+    sendRequest(function (dict) {\n+        printTopWords(n, dict);\n+    });\n+};\n+\n+exports.count = function (word) {\n+    sendRequest(function (dict) {\n+        getCountRepetitions(word, dict);\n+    });\n+};\n+\n+function sendRequest(callback) {\n+    request(getRequest(url), function (err, res, body) {\n+        if (!err && res.statusCode === 200) {","path":"counter.js","position":27,"original_position":27,"commit_id":"b5eaba031337443b9dc1f8066f3e76d0b18eb0b0","original_commit_id":"b5eaba031337443b9dc1f8066f3e76d0b18eb0b0","user":{"login":"maxvipon","id":871596,"avatar_url":"https://avatars.githubusercontent.com/u/871596?v=3","gravatar_id":"","url":"https://api.github.com/users/maxvipon","html_url":"https://github.com/maxvipon","followers_url":"https://api.github.com/users/maxvipon/followers","following_url":"https://api.github.com/users/maxvipon/following{/other_user}","gists_url":"https://api.github.com/users/maxvipon/gists{/gist_id}","starred_url":"https://api.github.com/users/maxvipon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxvipon/subscriptions","organizations_url":"https://api.github.com/users/maxvipon/orgs","repos_url":"https://api.github.com/users/maxvipon/repos","events_url":"https://api.github.com/users/maxvipon/events{/privacy}","received_events_url":"https://api.github.com/users/maxvipon/received_events","type":"User","site_admin":false},"body":"Обычно пишут наоборот\r\n```js\r\nif (err) {\r\n  throw err;\r\n}\r\n\r\nif (res.statusCode !== 200) {\r\n  throw new Error('Server returns ' + res.statusCode);\r\n}\r\n\r\n// process valid response\r\n```\r\n\r\nчтобы код имел меньшую вложенность, следовательно, лучше читался.","created_at":"2016-02-29T04:35:38Z","updated_at":"2016-02-29T04:35:38Z","html_url":"https://github.com/urfu-2015/webdev-tasks-1/pull/10#discussion_r54368593","pull_request_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/comments/54368593"},"html":{"href":"https://github.com/urfu-2015/webdev-tasks-1/pull/10#discussion_r54368593"},"pull_request":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10","id":60463895,"html_url":"https://github.com/urfu-2015/webdev-tasks-1/pull/10","diff_url":"https://github.com/urfu-2015/webdev-tasks-1/pull/10.diff","patch_url":"https://github.com/urfu-2015/webdev-tasks-1/pull/10.patch","issue_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues/10","number":10,"state":"open","locked":false,"title":"Баженова Анна","user":{"login":"bazhenova","id":12410663,"avatar_url":"https://avatars.githubusercontent.com/u/12410663?v=3","gravatar_id":"","url":"https://api.github.com/users/bazhenova","html_url":"https://github.com/bazhenova","followers_url":"https://api.github.com/users/bazhenova/followers","following_url":"https://api.github.com/users/bazhenova/following{/other_user}","gists_url":"https://api.github.com/users/bazhenova/gists{/gist_id}","starred_url":"https://api.github.com/users/bazhenova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazhenova/subscriptions","organizations_url":"https://api.github.com/users/bazhenova/orgs","repos_url":"https://api.github.com/users/bazhenova/repos","events_url":"https://api.github.com/users/bazhenova/events{/privacy}","received_events_url":"https://api.github.com/users/bazhenova/received_events","type":"User","site_admin":false},"body":"Топ 10 слов:\r\nвы 69\r\nон 60\r\nмы 53\r\nэту 53\r\nзадание 52\r\nэлементы 50\r\nкод 49\r\nвсё 46\r\nзадача 45\r\nтребования 44","created_at":"2016-02-24T06:46:45Z","updated_at":"2016-02-29T04:35:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"219d88a7c161a0254096dbbd699eed95018f5ece","assignee":{"login":"maxvipon","id":871596,"avatar_url":"https://avatars.githubusercontent.com/u/871596?v=3","gravatar_id":"","url":"https://api.github.com/users/maxvipon","html_url":"https://github.com/maxvipon","followers_url":"https://api.github.com/users/maxvipon/followers","following_url":"https://api.github.com/users/maxvipon/following{/other_user}","gists_url":"https://api.github.com/users/maxvipon/gists{/gist_id}","starred_url":"https://api.github.com/users/maxvipon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxvipon/subscriptions","organizations_url":"https://api.github.com/users/maxvipon/orgs","repos_url":"https://api.github.com/users/maxvipon/repos","events_url":"https://api.github.com/users/maxvipon/events{/privacy}","received_events_url":"https://api.github.com/users/maxvipon/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10/commits","review_comments_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10/comments","review_comment_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/comments{/number}","comments_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues/10/comments","statuses_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/statuses/b5eaba031337443b9dc1f8066f3e76d0b18eb0b0","head":{"label":"bazhenova:master","ref":"master","sha":"b5eaba031337443b9dc1f8066f3e76d0b18eb0b0","user":{"login":"bazhenova","id":12410663,"avatar_url":"https://avatars.githubusercontent.com/u/12410663?v=3","gravatar_id":"","url":"https://api.github.com/users/bazhenova","html_url":"https://github.com/bazhenova","followers_url":"https://api.github.com/users/bazhenova/followers","following_url":"https://api.github.com/users/bazhenova/following{/other_user}","gists_url":"https://api.github.com/users/bazhenova/gists{/gist_id}","starred_url":"https://api.github.com/users/bazhenova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazhenova/subscriptions","organizations_url":"https://api.github.com/users/bazhenova/orgs","repos_url":"https://api.github.com/users/bazhenova/repos","events_url":"https://api.github.com/users/bazhenova/events{/privacy}","received_events_url":"https://api.github.com/users/bazhenova/received_events","type":"User","site_admin":false},"repo":{"id":52154657,"name":"webdev-tasks-1","full_name":"bazhenova/webdev-tasks-1","owner":{"login":"bazhenova","id":12410663,"avatar_url":"https://avatars.githubusercontent.com/u/12410663?v=3","gravatar_id":"","url":"https://api.github.com/users/bazhenova","html_url":"https://github.com/bazhenova","followers_url":"https://api.github.com/users/bazhenova/followers","following_url":"https://api.github.com/users/bazhenova/following{/other_user}","gists_url":"https://api.github.com/users/bazhenova/gists{/gist_id}","starred_url":"https://api.github.com/users/bazhenova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bazhenova/subscriptions","organizations_url":"https://api.github.com/users/bazhenova/orgs","repos_url":"https://api.github.com/users/bazhenova/repos","events_url":"https://api.github.com/users/bazhenova/events{/privacy}","received_events_url":"https://api.github.com/users/bazhenova/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bazhenova/webdev-tasks-1","description":"","fork":true,"url":"https://api.github.com/repos/bazhenova/webdev-tasks-1","forks_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/forks","keys_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/teams","hooks_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/hooks","issue_events_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/issues/events{/number}","events_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/events","assignees_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/assignees{/user}","branches_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/branches{/branch}","tags_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/tags","blobs_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/statuses/{sha}","languages_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/languages","stargazers_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/stargazers","contributors_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/contributors","subscribers_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/subscribers","subscription_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/subscription","commits_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/contents/{+path}","compare_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/merges","archive_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/downloads","issues_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/issues{/number}","pulls_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/pulls{/number}","milestones_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/milestones{/number}","notifications_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/labels{/name}","releases_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/releases{/id}","deployments_url":"https://api.github.com/repos/bazhenova/webdev-tasks-1/deployments","created_at":"2016-02-20T13:29:12Z","updated_at":"2016-02-24T06:46:20Z","pushed_at":"2016-02-24T06:46:17Z","git_url":"git://github.com/bazhenova/webdev-tasks-1.git","ssh_url":"git@github.com:bazhenova/webdev-tasks-1.git","clone_url":"https://github.com/bazhenova/webdev-tasks-1.git","svn_url":"https://github.com/bazhenova/webdev-tasks-1","homepage":null,"size":6,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"urfu-2015:master","ref":"master","sha":"6ff732253132f88e1eec631e611136f3676768b7","user":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"repo":{"id":52003967,"name":"webdev-tasks-1","full_name":"urfu-2015/webdev-tasks-1","owner":{"login":"urfu-2015","id":14800971,"avatar_url":"https://avatars.githubusercontent.com/u/14800971?v=3","gravatar_id":"","url":"https://api.github.com/users/urfu-2015","html_url":"https://github.com/urfu-2015","followers_url":"https://api.github.com/users/urfu-2015/followers","following_url":"https://api.github.com/users/urfu-2015/following{/other_user}","gists_url":"https://api.github.com/users/urfu-2015/gists{/gist_id}","starred_url":"https://api.github.com/users/urfu-2015/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/urfu-2015/subscriptions","organizations_url":"https://api.github.com/users/urfu-2015/orgs","repos_url":"https://api.github.com/users/urfu-2015/repos","events_url":"https://api.github.com/users/urfu-2015/events{/privacy}","received_events_url":"https://api.github.com/users/urfu-2015/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/urfu-2015/webdev-tasks-1","description":"","fork":false,"url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1","forks_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/forks","keys_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/keys{/key_id}","collaborators_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/teams","hooks_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/hooks","issue_events_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues/events{/number}","events_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/events","assignees_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/assignees{/user}","branches_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/branches{/branch}","tags_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/tags","blobs_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/git/refs{/sha}","trees_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/git/trees{/sha}","statuses_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/statuses/{sha}","languages_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/languages","stargazers_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/stargazers","contributors_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/contributors","subscribers_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/subscribers","subscription_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/subscription","commits_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/commits{/sha}","git_commits_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/git/commits{/sha}","comments_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/comments{/number}","issue_comment_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues/comments{/number}","contents_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/contents/{+path}","compare_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/compare/{base}...{head}","merges_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/merges","archive_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/downloads","issues_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues{/number}","pulls_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls{/number}","milestones_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/milestones{/number}","notifications_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/labels{/name}","releases_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/releases{/id}","deployments_url":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/deployments","created_at":"2016-02-18T11:54:14Z","updated_at":"2016-02-18T11:54:14Z","pushed_at":"2016-02-28T21:26:22Z","git_url":"git://github.com/urfu-2015/webdev-tasks-1.git","ssh_url":"git@github.com:urfu-2015/webdev-tasks-1.git","clone_url":"https://github.com/urfu-2015/webdev-tasks-1.git","svn_url":"https://github.com/urfu-2015/webdev-tasks-1","homepage":null,"size":5,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":20,"forks":34,"open_issues":20,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10"},"html":{"href":"https://github.com/urfu-2015/webdev-tasks-1/pull/10"},"issue":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues/10"},"comments":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/urfu-2015/webdev-tasks-1/statuses/b5eaba031337443b9dc1f8066f3e76d0b18eb0b0"}}}}