{"action":"created","comment":{"url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/comments/99048223","pull_request_review_id":19709557,"id":99048223,"diff_hunk":"@@ -1,20 +1,57 @@\n import Logger from './helpers/logger';\n import GitHubService from './services/github';\n import Http from './helpers/http';\n+import Url from \"url\";\n+import QueryString from \"querystring\";\n+import Controller from \"./Controller\"\n \n const baseUrl = \"https://api.github.com/\";\n const organisationId = \"uber\";\n-const gitHubApiAuthToken = \"\"; //add your GitHub API OAuth key here to increase request limit\n+const gitHubApiAuthToken = \"915fa9458cabcffab770ba07faadfc0b23ea707e\"; //OAuth key\n \n let logger = new Logger();\n let http = new Http();\n \n let gitHubService = new GitHubService(baseUrl, http, gitHubApiAuthToken);\n \n-gitHubService.getUsersForOrganisation(organisationId).then((users) => {\n-    users.forEach((user) => {\n-        logger.log(\"Username: \" + user.login);\n-    });\n+var controller = new Controller(organisationId,gitHubService, logger)\n+\n+\n+//github API paginates the list of ubers users to 30 per page\n+//we need to get amount of pages first(IE amount of requests to make)\n+gitHubService.getHeaderForUsers(organisationId).then(function(header){\n+    //param header returns the header information from an API call\n+    \n+    controller.amountPages = getAmountOfPagesFromHeader(header)\n+    \n+    controller.getAllUsers(function(){\n+        \n+        controller.getAllUsersRepos(function(){\n+            controller.displayAll()\n+            //controller.ouputToFile(\"output.txt\")\n+        })\n+        \n+    })\n+    \n }).catch((error) => {\n     logger.log(\"Error: \" + error);\n-});\n\\ No newline at end of file\n+});\n+\n+\n+\n+\n+/*  -------------------------- MISC FUNCTIONS -------------------------------  */\n+\n+//extracts amount of pages for users from the API response header\n+function getAmountOfPagesFromHeader(header){","path":"test-two/src/index.js","position":53,"original_position":53,"commit_id":"63465fadf73e14cc2ad2629eb3aceea1a26d5732","original_commit_id":"63465fadf73e14cc2ad2629eb3aceea1a26d5732","user":{"login":"danwfeeney","id":12492091,"avatar_url":"https://avatars.githubusercontent.com/u/12492091?v=3","gravatar_id":"","url":"https://api.github.com/users/danwfeeney","html_url":"https://github.com/danwfeeney","followers_url":"https://api.github.com/users/danwfeeney/followers","following_url":"https://api.github.com/users/danwfeeney/following{/other_user}","gists_url":"https://api.github.com/users/danwfeeney/gists{/gist_id}","starred_url":"https://api.github.com/users/danwfeeney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danwfeeney/subscriptions","organizations_url":"https://api.github.com/users/danwfeeney/orgs","repos_url":"https://api.github.com/users/danwfeeney/repos","events_url":"https://api.github.com/users/danwfeeney/events{/privacy}","received_events_url":"https://api.github.com/users/danwfeeney/received_events","type":"User","site_admin":false},"body":"Does this need to be unit tested?","created_at":"2017-02-02T03:39:33Z","updated_at":"2017-02-02T04:00:44Z","html_url":"https://github.com/the-ticket-group/show-us-what-you-got/pull/4#discussion_r99048223","pull_request_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/comments/99048223"},"html":{"href":"https://github.com/the-ticket-group/show-us-what-you-got/pull/4#discussion_r99048223"},"pull_request":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4","id":104226031,"html_url":"https://github.com/the-ticket-group/show-us-what-you-got/pull/4","diff_url":"https://github.com/the-ticket-group/show-us-what-you-got/pull/4.diff","patch_url":"https://github.com/the-ticket-group/show-us-what-you-got/pull/4.patch","issue_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues/4","number":4,"state":"open","locked":false,"title":"Darryl M. - Code Challenge.","user":{"login":"dazMurph90","id":11529734,"avatar_url":"https://avatars.githubusercontent.com/u/11529734?v=3","gravatar_id":"","url":"https://api.github.com/users/dazMurph90","html_url":"https://github.com/dazMurph90","followers_url":"https://api.github.com/users/dazMurph90/followers","following_url":"https://api.github.com/users/dazMurph90/following{/other_user}","gists_url":"https://api.github.com/users/dazMurph90/gists{/gist_id}","starred_url":"https://api.github.com/users/dazMurph90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dazMurph90/subscriptions","organizations_url":"https://api.github.com/users/dazMurph90/orgs","repos_url":"https://api.github.com/users/dazMurph90/repos","events_url":"https://api.github.com/users/dazMurph90/events{/privacy}","received_events_url":"https://api.github.com/users/dazMurph90/received_events","type":"User","site_admin":false},"body":"Darryl M. - Code Challenge.","created_at":"2017-02-01T21:30:10Z","updated_at":"2017-02-02T04:00:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8048327d68c72133e2753bbe296e4fe94a32b210","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4/commits","review_comments_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4/comments","review_comment_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/comments{/number}","comments_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues/4/comments","statuses_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/statuses/63465fadf73e14cc2ad2629eb3aceea1a26d5732","head":{"label":"dazMurph90:master","ref":"master","sha":"63465fadf73e14cc2ad2629eb3aceea1a26d5732","user":{"login":"dazMurph90","id":11529734,"avatar_url":"https://avatars.githubusercontent.com/u/11529734?v=3","gravatar_id":"","url":"https://api.github.com/users/dazMurph90","html_url":"https://github.com/dazMurph90","followers_url":"https://api.github.com/users/dazMurph90/followers","following_url":"https://api.github.com/users/dazMurph90/following{/other_user}","gists_url":"https://api.github.com/users/dazMurph90/gists{/gist_id}","starred_url":"https://api.github.com/users/dazMurph90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dazMurph90/subscriptions","organizations_url":"https://api.github.com/users/dazMurph90/orgs","repos_url":"https://api.github.com/users/dazMurph90/repos","events_url":"https://api.github.com/users/dazMurph90/events{/privacy}","received_events_url":"https://api.github.com/users/dazMurph90/received_events","type":"User","site_admin":false},"repo":{"id":80588762,"name":"show-us-what-you-got","full_name":"dazMurph90/show-us-what-you-got","owner":{"login":"dazMurph90","id":11529734,"avatar_url":"https://avatars.githubusercontent.com/u/11529734?v=3","gravatar_id":"","url":"https://api.github.com/users/dazMurph90","html_url":"https://github.com/dazMurph90","followers_url":"https://api.github.com/users/dazMurph90/followers","following_url":"https://api.github.com/users/dazMurph90/following{/other_user}","gists_url":"https://api.github.com/users/dazMurph90/gists{/gist_id}","starred_url":"https://api.github.com/users/dazMurph90/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dazMurph90/subscriptions","organizations_url":"https://api.github.com/users/dazMurph90/orgs","repos_url":"https://api.github.com/users/dazMurph90/repos","events_url":"https://api.github.com/users/dazMurph90/events{/privacy}","received_events_url":"https://api.github.com/users/dazMurph90/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dazMurph90/show-us-what-you-got","description":"A project given to new candidates to get a feel for how we would work together","fork":true,"url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got","forks_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/forks","keys_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/teams","hooks_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/hooks","issue_events_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/issues/events{/number}","events_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/events","assignees_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/assignees{/user}","branches_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/branches{/branch}","tags_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/tags","blobs_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/git/refs{/sha}","trees_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/statuses/{sha}","languages_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/languages","stargazers_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/stargazers","contributors_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/contributors","subscribers_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/subscribers","subscription_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/subscription","commits_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/commits{/sha}","git_commits_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/git/commits{/sha}","comments_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/comments{/number}","issue_comment_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/issues/comments{/number}","contents_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/contents/{+path}","compare_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/merges","archive_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/downloads","issues_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/issues{/number}","pulls_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/pulls{/number}","milestones_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/milestones{/number}","notifications_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/labels{/name}","releases_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/releases{/id}","deployments_url":"https://api.github.com/repos/dazMurph90/show-us-what-you-got/deployments","created_at":"2017-02-01T04:15:37Z","updated_at":"2017-02-01T04:15:39Z","pushed_at":"2017-02-01T21:30:07Z","git_url":"git://github.com/dazMurph90/show-us-what-you-got.git","ssh_url":"git@github.com:dazMurph90/show-us-what-you-got.git","clone_url":"https://github.com/dazMurph90/show-us-what-you-got.git","svn_url":"https://github.com/dazMurph90/show-us-what-you-got","homepage":null,"size":30,"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":"the-ticket-group:master","ref":"master","sha":"f4693ed51286f98e4c272e9960f1265f4c03970f","user":{"login":"the-ticket-group","id":24848808,"avatar_url":"https://avatars.githubusercontent.com/u/24848808?v=3","gravatar_id":"","url":"https://api.github.com/users/the-ticket-group","html_url":"https://github.com/the-ticket-group","followers_url":"https://api.github.com/users/the-ticket-group/followers","following_url":"https://api.github.com/users/the-ticket-group/following{/other_user}","gists_url":"https://api.github.com/users/the-ticket-group/gists{/gist_id}","starred_url":"https://api.github.com/users/the-ticket-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the-ticket-group/subscriptions","organizations_url":"https://api.github.com/users/the-ticket-group/orgs","repos_url":"https://api.github.com/users/the-ticket-group/repos","events_url":"https://api.github.com/users/the-ticket-group/events{/privacy}","received_events_url":"https://api.github.com/users/the-ticket-group/received_events","type":"Organization","site_admin":false},"repo":{"id":78997814,"name":"show-us-what-you-got","full_name":"the-ticket-group/show-us-what-you-got","owner":{"login":"the-ticket-group","id":24848808,"avatar_url":"https://avatars.githubusercontent.com/u/24848808?v=3","gravatar_id":"","url":"https://api.github.com/users/the-ticket-group","html_url":"https://github.com/the-ticket-group","followers_url":"https://api.github.com/users/the-ticket-group/followers","following_url":"https://api.github.com/users/the-ticket-group/following{/other_user}","gists_url":"https://api.github.com/users/the-ticket-group/gists{/gist_id}","starred_url":"https://api.github.com/users/the-ticket-group/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/the-ticket-group/subscriptions","organizations_url":"https://api.github.com/users/the-ticket-group/orgs","repos_url":"https://api.github.com/users/the-ticket-group/repos","events_url":"https://api.github.com/users/the-ticket-group/events{/privacy}","received_events_url":"https://api.github.com/users/the-ticket-group/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/the-ticket-group/show-us-what-you-got","description":"A project given to new candidates to get a feel for how we would work together","fork":false,"url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got","forks_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/forks","keys_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/keys{/key_id}","collaborators_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/teams","hooks_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/hooks","issue_events_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues/events{/number}","events_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/events","assignees_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/assignees{/user}","branches_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/branches{/branch}","tags_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/tags","blobs_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/git/refs{/sha}","trees_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/git/trees{/sha}","statuses_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/statuses/{sha}","languages_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/languages","stargazers_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/stargazers","contributors_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/contributors","subscribers_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/subscribers","subscription_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/subscription","commits_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/commits{/sha}","git_commits_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/git/commits{/sha}","comments_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/comments{/number}","issue_comment_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues/comments{/number}","contents_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/contents/{+path}","compare_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/compare/{base}...{head}","merges_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/merges","archive_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/downloads","issues_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues{/number}","pulls_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls{/number}","milestones_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/milestones{/number}","notifications_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/labels{/name}","releases_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/releases{/id}","deployments_url":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/deployments","created_at":"2017-01-15T04:48:02Z","updated_at":"2017-01-15T09:37:27Z","pushed_at":"2017-02-02T02:14:29Z","git_url":"git://github.com/the-ticket-group/show-us-what-you-got.git","ssh_url":"git@github.com:the-ticket-group/show-us-what-you-got.git","clone_url":"https://github.com/the-ticket-group/show-us-what-you-got.git","svn_url":"https://github.com/the-ticket-group/show-us-what-you-got","homepage":null,"size":9,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"open_issues_count":6,"forks":7,"open_issues":6,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4"},"html":{"href":"https://github.com/the-ticket-group/show-us-what-you-got/pull/4"},"issue":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues/4"},"comments":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/the-ticket-group/show-us-what-you-got/statuses/63465fadf73e14cc2ad2629eb3aceea1a26d5732"}}}}
{"actor":{"display_login":"danwfeeney"}}