{"action":"created","comment":{"url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments/231528781","pull_request_review_id":172510626,"id":231528781,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzMTUyODc4MQ==","diff_hunk":"@@ -31,14 +34,83 @@\n   }\n \n   function main(url) {\n-    fetchJSON(url, (err, data) => {\n-      const root = document.getElementById('root');\n-      if (err) {\n-        createAndAppend('div', root, { text: err.message, class: 'alert-error' });\n-      } else {\n-        createAndAppend('pre', root, { text: JSON.stringify(data, null, 2) });\n-      }\n-    });\n+    fetchJSON(url)\n+      .then(data => {\n+        const root = document.getElementById('root');\n+        const repositoryDiv = createAndAppend('div', root, { class: 'repositoryDiv' });\n+        const header = createAndAppend('header', repositoryDiv, { class: 'topping' });\n+        createAndAppend('h1', header, { html: 'HYF Repositories ', class: 'hyfRepo' });\n+        const selectBox = createAndAppend('select', header, { class: 'select-box' });\n+        data.sort(function (a, b) { return a.name.localeCompare(b.name); });\n+        for (let i = 0; i < data.length; i++) {\n+          createAndAppend('option', selectBox, { value: i, html: data[i].name });\n+        }\n+        const infoBox = createAndAppend('div', root, { class: 'infoBox' });\n+        const ContributorBox = createAndAppend('div', root, { class: 'ContributorBox' });\n+        selectBox.addEventListener('change', () => {\n+          const value = data[selectBox.selectedIndex].url;\n+          fetchJSON(value)\n+            .then(data => {\n+              repositoryInfo(infoBox, data, value);\n+            });\n+          const contributors = data[selectBox.selectedIndex].contributors_url;\n+          fetchJSON(contributors)\n+            .then(data => {\n+              ContributorsInfo(ContributorBox, data, contributors);\n+            });\n+        });\n+        fetchJSON(data[0].url)\n+          .then(data => {\n+            repositoryInfo(infoBox, data);\n+          });\n+        fetchJSON(data[0].contributors_url)\n+          .then(data => {\n+            ContributorsInfo(ContributorBox, data);\n+          });\n+      })\n+      .catch(err => {\n+        const root = document.getElementById('root');\n+        createAndAppend('div', root, { html: err.message, class: 'alert-error' });\n+\n+      });\n+  }\n+\n+  //adding rows function\n+  function addRow(label, value, tbody) {\n+    const row = createAndAppend('tr', tbody);\n+    createAndAppend('td', row, { html: label });\n+    createAndAppend('td', row, { html: value });\n+  }\n+\n+  //information box of each repository\n+  function repositoryInfo(infoBox, data) {\n+    infoBox.innerHTML = '';\n+    const table = createAndAppend('table', infoBox, { class: 'infoTable' });\n+    const tbody = createAndAppend('tbody', table);\n+    addRow('Repository', data.name, tbody);","path":"homework/src/index.js","position":112,"original_position":112,"commit_id":"e61220df752edf4d5ea8fe919509e3c531679757","original_commit_id":"e61220df752edf4d5ea8fe919509e3c531679757","user":{"login":"remarcmij","id":2788771,"node_id":"MDQ6VXNlcjI3ODg3NzE=","avatar_url":"https://avatars0.githubusercontent.com/u/2788771?v=4","gravatar_id":"","url":"https://api.github.com/users/remarcmij","html_url":"https://github.com/remarcmij","followers_url":"https://api.github.com/users/remarcmij/followers","following_url":"https://api.github.com/users/remarcmij/following{/other_user}","gists_url":"https://api.github.com/users/remarcmij/gists{/gist_id}","starred_url":"https://api.github.com/users/remarcmij/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remarcmij/subscriptions","organizations_url":"https://api.github.com/users/remarcmij/orgs","repos_url":"https://api.github.com/users/remarcmij/repos","events_url":"https://api.github.com/users/remarcmij/events{/privacy}","received_events_url":"https://api.github.com/users/remarcmij/received_events","type":"User","site_admin":false},"body":"The repository name is supposed to be clickable link that takes you to the GitHub page of the selected repository.","created_at":"2018-11-07T14:37:16Z","updated_at":"2018-11-07T14:51:08Z","html_url":"https://github.com/HackYourFuture/JavaScript3/pull/115#discussion_r231528781","pull_request_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments/231528781"},"html":{"href":"https://github.com/HackYourFuture/JavaScript3/pull/115#discussion_r231528781"},"pull_request":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115"}}},"pull_request":{"url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115","id":226351168,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MzUxMTY4","html_url":"https://github.com/HackYourFuture/JavaScript3/pull/115","diff_url":"https://github.com/HackYourFuture/JavaScript3/pull/115.diff","patch_url":"https://github.com/HackYourFuture/JavaScript3/pull/115.patch","issue_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/115","number":115,"state":"open","locked":false,"title":"Week2","user":{"login":"KaramGhazzi","id":39863265,"node_id":"MDQ6VXNlcjM5ODYzMjY1","avatar_url":"https://avatars0.githubusercontent.com/u/39863265?v=4","gravatar_id":"","url":"https://api.github.com/users/KaramGhazzi","html_url":"https://github.com/KaramGhazzi","followers_url":"https://api.github.com/users/KaramGhazzi/followers","following_url":"https://api.github.com/users/KaramGhazzi/following{/other_user}","gists_url":"https://api.github.com/users/KaramGhazzi/gists{/gist_id}","starred_url":"https://api.github.com/users/KaramGhazzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaramGhazzi/subscriptions","organizations_url":"https://api.github.com/users/KaramGhazzi/orgs","repos_url":"https://api.github.com/users/KaramGhazzi/repos","events_url":"https://api.github.com/users/KaramGhazzi/events{/privacy}","received_events_url":"https://api.github.com/users/KaramGhazzi/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-28T08:28:13Z","updated_at":"2018-11-07T14:51:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e022a1ab1cbdd398625f0361e2e0b3af0faa46f5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1090926797,"node_id":"MDU6TGFiZWwxMDkwOTI2Nzk3","url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels/class17","name":"class17","color":"fef2c0","default":false},{"id":971397742,"node_id":"MDU6TGFiZWw5NzEzOTc3NDI=","url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels/homework2","name":"homework2","color":"fff699","default":false},{"id":1023924913,"node_id":"MDU6TGFiZWwxMDIzOTI0OTEz","url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels/review%20in%20progress","name":"review in progress","color":"f9d0c4","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115/commits","review_comments_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115/comments","review_comment_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/115/comments","statuses_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/statuses/e61220df752edf4d5ea8fe919509e3c531679757","head":{"label":"KaramGhazzi:week2","ref":"week2","sha":"e61220df752edf4d5ea8fe919509e3c531679757","user":{"login":"KaramGhazzi","id":39863265,"node_id":"MDQ6VXNlcjM5ODYzMjY1","avatar_url":"https://avatars0.githubusercontent.com/u/39863265?v=4","gravatar_id":"","url":"https://api.github.com/users/KaramGhazzi","html_url":"https://github.com/KaramGhazzi","followers_url":"https://api.github.com/users/KaramGhazzi/followers","following_url":"https://api.github.com/users/KaramGhazzi/following{/other_user}","gists_url":"https://api.github.com/users/KaramGhazzi/gists{/gist_id}","starred_url":"https://api.github.com/users/KaramGhazzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaramGhazzi/subscriptions","organizations_url":"https://api.github.com/users/KaramGhazzi/orgs","repos_url":"https://api.github.com/users/KaramGhazzi/repos","events_url":"https://api.github.com/users/KaramGhazzi/events{/privacy}","received_events_url":"https://api.github.com/users/KaramGhazzi/received_events","type":"User","site_admin":false},"repo":{"id":153692384,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM2OTIzODQ=","name":"JavaScript3","full_name":"KaramGhazzi/JavaScript3","private":false,"owner":{"login":"KaramGhazzi","id":39863265,"node_id":"MDQ6VXNlcjM5ODYzMjY1","avatar_url":"https://avatars0.githubusercontent.com/u/39863265?v=4","gravatar_id":"","url":"https://api.github.com/users/KaramGhazzi","html_url":"https://github.com/KaramGhazzi","followers_url":"https://api.github.com/users/KaramGhazzi/followers","following_url":"https://api.github.com/users/KaramGhazzi/following{/other_user}","gists_url":"https://api.github.com/users/KaramGhazzi/gists{/gist_id}","starred_url":"https://api.github.com/users/KaramGhazzi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KaramGhazzi/subscriptions","organizations_url":"https://api.github.com/users/KaramGhazzi/orgs","repos_url":"https://api.github.com/users/KaramGhazzi/repos","events_url":"https://api.github.com/users/KaramGhazzi/events{/privacy}","received_events_url":"https://api.github.com/users/KaramGhazzi/received_events","type":"User","site_admin":false},"html_url":"https://github.com/KaramGhazzi/JavaScript3","description":"Course content for the JavaScript3 module","fork":true,"url":"https://api.github.com/repos/KaramGhazzi/JavaScript3","forks_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/forks","keys_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/teams","hooks_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/hooks","issue_events_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/issues/events{/number}","events_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/events","assignees_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/assignees{/user}","branches_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/branches{/branch}","tags_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/tags","blobs_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/git/refs{/sha}","trees_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/statuses/{sha}","languages_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/languages","stargazers_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/stargazers","contributors_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/contributors","subscribers_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/subscribers","subscription_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/subscription","commits_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/commits{/sha}","git_commits_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/git/commits{/sha}","comments_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/comments{/number}","issue_comment_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/issues/comments{/number}","contents_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/contents/{+path}","compare_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/merges","archive_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/downloads","issues_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/issues{/number}","pulls_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/pulls{/number}","milestones_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/milestones{/number}","notifications_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/labels{/name}","releases_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/releases{/id}","deployments_url":"https://api.github.com/repos/KaramGhazzi/JavaScript3/deployments","created_at":"2018-10-18T21:57:07Z","updated_at":"2018-10-18T21:57:09Z","pushed_at":"2018-10-28T08:26:58Z","git_url":"git://github.com/KaramGhazzi/JavaScript3.git","ssh_url":"git@github.com:KaramGhazzi/JavaScript3.git","clone_url":"https://github.com/KaramGhazzi/JavaScript3.git","svn_url":"https://github.com/KaramGhazzi/JavaScript3","homepage":null,"size":11280,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HackYourFuture:master","ref":"master","sha":"1c03673bb2258cd849f95de335a142c743393b3b","user":{"login":"HackYourFuture","id":20858568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODU4NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/20858568?v=4","gravatar_id":"","url":"https://api.github.com/users/HackYourFuture","html_url":"https://github.com/HackYourFuture","followers_url":"https://api.github.com/users/HackYourFuture/followers","following_url":"https://api.github.com/users/HackYourFuture/following{/other_user}","gists_url":"https://api.github.com/users/HackYourFuture/gists{/gist_id}","starred_url":"https://api.github.com/users/HackYourFuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackYourFuture/subscriptions","organizations_url":"https://api.github.com/users/HackYourFuture/orgs","repos_url":"https://api.github.com/users/HackYourFuture/repos","events_url":"https://api.github.com/users/HackYourFuture/events{/privacy}","received_events_url":"https://api.github.com/users/HackYourFuture/received_events","type":"Organization","site_admin":false},"repo":{"id":124885319,"node_id":"MDEwOlJlcG9zaXRvcnkxMjQ4ODUzMTk=","name":"JavaScript3","full_name":"HackYourFuture/JavaScript3","private":false,"owner":{"login":"HackYourFuture","id":20858568,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwODU4NTY4","avatar_url":"https://avatars2.githubusercontent.com/u/20858568?v=4","gravatar_id":"","url":"https://api.github.com/users/HackYourFuture","html_url":"https://github.com/HackYourFuture","followers_url":"https://api.github.com/users/HackYourFuture/followers","following_url":"https://api.github.com/users/HackYourFuture/following{/other_user}","gists_url":"https://api.github.com/users/HackYourFuture/gists{/gist_id}","starred_url":"https://api.github.com/users/HackYourFuture/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HackYourFuture/subscriptions","organizations_url":"https://api.github.com/users/HackYourFuture/orgs","repos_url":"https://api.github.com/users/HackYourFuture/repos","events_url":"https://api.github.com/users/HackYourFuture/events{/privacy}","received_events_url":"https://api.github.com/users/HackYourFuture/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/HackYourFuture/JavaScript3","description":"Course content for the JavaScript3 module","fork":false,"url":"https://api.github.com/repos/HackYourFuture/JavaScript3","forks_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/forks","keys_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/teams","hooks_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/hooks","issue_events_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/events{/number}","events_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/events","assignees_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/assignees{/user}","branches_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/branches{/branch}","tags_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/tags","blobs_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/git/refs{/sha}","trees_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/statuses/{sha}","languages_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/languages","stargazers_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/stargazers","contributors_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/contributors","subscribers_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/subscribers","subscription_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/subscription","commits_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/commits{/sha}","git_commits_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/git/commits{/sha}","comments_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/comments{/number}","issue_comment_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/comments{/number}","contents_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/contents/{+path}","compare_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/merges","archive_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/downloads","issues_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues{/number}","pulls_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls{/number}","milestones_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/milestones{/number}","notifications_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels{/name}","releases_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/releases{/id}","deployments_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/deployments","created_at":"2018-03-12T12:24:51Z","updated_at":"2018-10-13T13:44:56Z","pushed_at":"2018-11-06T20:33:20Z","git_url":"git://github.com/HackYourFuture/JavaScript3.git","ssh_url":"git@github.com:HackYourFuture/JavaScript3.git","clone_url":"https://github.com/HackYourFuture/JavaScript3.git","svn_url":"https://github.com/HackYourFuture/JavaScript3","homepage":null,"size":11274,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":54,"mirror_url":null,"archived":false,"open_issues_count":31,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":54,"open_issues":31,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115"},"html":{"href":"https://github.com/HackYourFuture/JavaScript3/pull/115"},"issue":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/115"},"comments":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/115/comments"},"review_comments":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115/comments"},"review_comment":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/115/commits"},"statuses":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/statuses/e61220df752edf4d5ea8fe919509e3c531679757"}},"author_association":"NONE"}}
{"actor":{"display_login":"remarcmij"}}