{"action":"created","comment":{"url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments/214702012","pull_request_review_id":151812449,"id":214702012,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNDcwMjAxMg==","diff_hunk":"@@ -30,18 +33,84 @@\n     return elem;\n   }\n \n-  function main(url) {\n-    fetchJSON(url, (err, data) => {\n-      const root = document.getElementById('root');\n-      if (err) {\n-        createAndAppend('div', root, { html: err.message, class: 'alert-error' });\n-      } else {\n-        createAndAppend('pre', root, { html: JSON.stringify(data, null, 2) });\n+  const HYF_REPOS_URL = 'https://api.github.com/orgs/HackYourFuture/repos?per_page=100';\n+  const root = document.getElementById('root');\n+  createAndAppend(\"img\", root, { src: \"./hyf.png\", id: \"imgLogo\" });\n+  const divSelect = createAndAppend(\"header\", root);\n+  createAndAppend(\"p\", divSelect, { html: \"HYF Repositories : \", id: \"pContributors\" });\n+  const repoSelect = createAndAppend(\"select\", divSelect);\n+  const divFlex = createAndAppend(\"section\", root);\n+  const divInfo = createAndAppend(\"article\", divFlex, { id: \"divInfo\" });\n+  const divCont = createAndAppend(\"article\", divFlex, { id: \"divCont\" });\n+\n+  function main(HYF_REPOS_URL) {\n+\n+    fetchJSON(HYF_REPOS_URL)\n+      .catch(error => {\n+        const divError = createAndAppend(\"container\", root, { id: \"divError\" });\n+        divError.innerHTML = \"\";\n+        divError.innerHTML = error;\n+        return;\n+      })\n+      .then(repositories => {\n+        repositories.forEach((repository, index) => {\n+          createAndAppend(\"option\", repoSelect, { html: repository.name, value: index });\n+        });\n+        repoSelect.addEventListener(\"change\", (event) => {\n+          const optionIndex = event.target.value;\n+          renderRepository(divInfo, repositories[optionIndex]);\n+          renderContributors(divCont, repositories[optionIndex]);\n+        });\n+        const initialRender = repositories[0];\n+        renderRepository(divInfo, initialRender);\n+        renderContributors(divCont, initialRender);\n       }\n-    });\n+      );\n   }\n \n-  const HYF_REPOS_URL = 'https://api.github.com/orgs/HackYourFuture/repos?per_page=100';\n+  function renderRepository(divInfo, repository) {\n+    divInfo.innerHTML = \"\";\n+    const table = createAndAppend(\"table\", divInfo);\n+    const tBody = createAndAppend(\"tBody\", table);\n+\n+    const trRepository = createAndAppend(\"tr\", tBody);\n+    createAndAppend(\"td\", trRepository, { html: \"Repository : \" });\n+    const tdRepoLink = createAndAppend(\"td\", trRepository, );\n+    const linkRepository = createAndAppend('a', tdRepoLink, { html: repository.name, href: repository.html_url });\n+\n+    const trDescription = createAndAppend(\"tr\", tBody);\n+    createAndAppend(\"td\", trDescription, { html: \"Description : \" });\n+    createAndAppend(\"td\", trDescription, { html: repository.description });\n \n+    const trForks = createAndAppend(\"tr\", tBody);\n+    createAndAppend(\"td\", trForks, { html: \"Forks : \" });\n+    const tdForksLink = createAndAppend(\"td\", trForks, );\n+    const linkForks = createAndAppend('a', tdForksLink, { html: repository.forks, href: repository.forks_url });\n+\n+    const trUpdated = createAndAppend(\"tr\", tBody);\n+    createAndAppend(\"td\", trUpdated, { html: \"Updated : \" });\n+    createAndAppend(\"td\", trUpdated, { html: repository.updated_at.toLocaleString() });\n+  }\n+\n+  function renderContributors(divCont, repository) {\n+    divCont.innerHTML = \"\";\n+    createAndAppend('h2', divCont, { html: \"Contributions\", class: \"h2\" });\n+\n+    fetchJSON(repository.contributors_url)\n+      .catch(error => {","path":"homework/src/index.js","position":114,"original_position":114,"commit_id":"bd091f4e68d64ec8c0a54b174a4fc77f643ee870","original_commit_id":"bd091f4e68d64ec8c0a54b174a4fc77f643ee870","user":{"login":"whitepiolin","id":39315387,"node_id":"MDQ6VXNlcjM5MzE1Mzg3","avatar_url":"https://avatars1.githubusercontent.com/u/39315387?v=4","gravatar_id":"","url":"https://api.github.com/users/whitepiolin","html_url":"https://github.com/whitepiolin","followers_url":"https://api.github.com/users/whitepiolin/followers","following_url":"https://api.github.com/users/whitepiolin/following{/other_user}","gists_url":"https://api.github.com/users/whitepiolin/gists{/gist_id}","starred_url":"https://api.github.com/users/whitepiolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitepiolin/subscriptions","organizations_url":"https://api.github.com/users/whitepiolin/orgs","repos_url":"https://api.github.com/users/whitepiolin/repos","events_url":"https://api.github.com/users/whitepiolin/events{/privacy}","received_events_url":"https://api.github.com/users/whitepiolin/received_events","type":"User","site_admin":false},"body":"Corrected","created_at":"2018-09-03T14:12:57Z","updated_at":"2018-09-03T14:12:57Z","html_url":"https://github.com/HackYourFuture/JavaScript3/pull/81#discussion_r214702012","pull_request_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments/214702012"},"html":{"href":"https://github.com/HackYourFuture/JavaScript3/pull/81#discussion_r214702012"},"pull_request":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81"}},"in_reply_to_id":214645826},"pull_request":{"url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81","id":212541220,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEyNTQxMjIw","html_url":"https://github.com/HackYourFuture/JavaScript3/pull/81","diff_url":"https://github.com/HackYourFuture/JavaScript3/pull/81.diff","patch_url":"https://github.com/HackYourFuture/JavaScript3/pull/81.patch","issue_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/81","number":81,"state":"open","locked":false,"title":"Js3 Week2 Barbaros","user":{"login":"whitepiolin","id":39315387,"node_id":"MDQ6VXNlcjM5MzE1Mzg3","avatar_url":"https://avatars1.githubusercontent.com/u/39315387?v=4","gravatar_id":"","url":"https://api.github.com/users/whitepiolin","html_url":"https://github.com/whitepiolin","followers_url":"https://api.github.com/users/whitepiolin/followers","following_url":"https://api.github.com/users/whitepiolin/following{/other_user}","gists_url":"https://api.github.com/users/whitepiolin/gists{/gist_id}","starred_url":"https://api.github.com/users/whitepiolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitepiolin/subscriptions","organizations_url":"https://api.github.com/users/whitepiolin/orgs","repos_url":"https://api.github.com/users/whitepiolin/repos","events_url":"https://api.github.com/users/whitepiolin/events{/privacy}","received_events_url":"https://api.github.com/users/whitepiolin/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-01T10:43:59Z","updated_at":"2018-09-03T14:12:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ca39a526c4ba0d06a8307634454b3ab288129b85","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":1018310322,"node_id":"MDU6TGFiZWwxMDE4MzEwMzIy","url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels/class16","name":"class16","color":"64a313","default":false},{"id":971397742,"node_id":"MDU6TGFiZWw5NzEzOTc3NDI=","url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels/homework2","name":"homework2","color":"fff699","default":false},{"id":966116443,"node_id":"MDU6TGFiZWw5NjYxMTY0NDM=","url":"https://api.github.com/repos/HackYourFuture/JavaScript3/labels/reviewed","name":"reviewed","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81/commits","review_comments_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81/comments","review_comment_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/81/comments","statuses_url":"https://api.github.com/repos/HackYourFuture/JavaScript3/statuses/bd091f4e68d64ec8c0a54b174a4fc77f643ee870","head":{"label":"whitepiolin:JS3Week2n","ref":"JS3Week2n","sha":"bd091f4e68d64ec8c0a54b174a4fc77f643ee870","user":{"login":"whitepiolin","id":39315387,"node_id":"MDQ6VXNlcjM5MzE1Mzg3","avatar_url":"https://avatars1.githubusercontent.com/u/39315387?v=4","gravatar_id":"","url":"https://api.github.com/users/whitepiolin","html_url":"https://github.com/whitepiolin","followers_url":"https://api.github.com/users/whitepiolin/followers","following_url":"https://api.github.com/users/whitepiolin/following{/other_user}","gists_url":"https://api.github.com/users/whitepiolin/gists{/gist_id}","starred_url":"https://api.github.com/users/whitepiolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitepiolin/subscriptions","organizations_url":"https://api.github.com/users/whitepiolin/orgs","repos_url":"https://api.github.com/users/whitepiolin/repos","events_url":"https://api.github.com/users/whitepiolin/events{/privacy}","received_events_url":"https://api.github.com/users/whitepiolin/received_events","type":"User","site_admin":false},"repo":{"id":146780980,"node_id":"MDEwOlJlcG9zaXRvcnkxNDY3ODA5ODA=","name":"JavaScript3","full_name":"whitepiolin/JavaScript3","owner":{"login":"whitepiolin","id":39315387,"node_id":"MDQ6VXNlcjM5MzE1Mzg3","avatar_url":"https://avatars1.githubusercontent.com/u/39315387?v=4","gravatar_id":"","url":"https://api.github.com/users/whitepiolin","html_url":"https://github.com/whitepiolin","followers_url":"https://api.github.com/users/whitepiolin/followers","following_url":"https://api.github.com/users/whitepiolin/following{/other_user}","gists_url":"https://api.github.com/users/whitepiolin/gists{/gist_id}","starred_url":"https://api.github.com/users/whitepiolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whitepiolin/subscriptions","organizations_url":"https://api.github.com/users/whitepiolin/orgs","repos_url":"https://api.github.com/users/whitepiolin/repos","events_url":"https://api.github.com/users/whitepiolin/events{/privacy}","received_events_url":"https://api.github.com/users/whitepiolin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/whitepiolin/JavaScript3","description":"Course content for the JavaScript3 module","fork":true,"url":"https://api.github.com/repos/whitepiolin/JavaScript3","forks_url":"https://api.github.com/repos/whitepiolin/JavaScript3/forks","keys_url":"https://api.github.com/repos/whitepiolin/JavaScript3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/whitepiolin/JavaScript3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/whitepiolin/JavaScript3/teams","hooks_url":"https://api.github.com/repos/whitepiolin/JavaScript3/hooks","issue_events_url":"https://api.github.com/repos/whitepiolin/JavaScript3/issues/events{/number}","events_url":"https://api.github.com/repos/whitepiolin/JavaScript3/events","assignees_url":"https://api.github.com/repos/whitepiolin/JavaScript3/assignees{/user}","branches_url":"https://api.github.com/repos/whitepiolin/JavaScript3/branches{/branch}","tags_url":"https://api.github.com/repos/whitepiolin/JavaScript3/tags","blobs_url":"https://api.github.com/repos/whitepiolin/JavaScript3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/whitepiolin/JavaScript3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/whitepiolin/JavaScript3/git/refs{/sha}","trees_url":"https://api.github.com/repos/whitepiolin/JavaScript3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/whitepiolin/JavaScript3/statuses/{sha}","languages_url":"https://api.github.com/repos/whitepiolin/JavaScript3/languages","stargazers_url":"https://api.github.com/repos/whitepiolin/JavaScript3/stargazers","contributors_url":"https://api.github.com/repos/whitepiolin/JavaScript3/contributors","subscribers_url":"https://api.github.com/repos/whitepiolin/JavaScript3/subscribers","subscription_url":"https://api.github.com/repos/whitepiolin/JavaScript3/subscription","commits_url":"https://api.github.com/repos/whitepiolin/JavaScript3/commits{/sha}","git_commits_url":"https://api.github.com/repos/whitepiolin/JavaScript3/git/commits{/sha}","comments_url":"https://api.github.com/repos/whitepiolin/JavaScript3/comments{/number}","issue_comment_url":"https://api.github.com/repos/whitepiolin/JavaScript3/issues/comments{/number}","contents_url":"https://api.github.com/repos/whitepiolin/JavaScript3/contents/{+path}","compare_url":"https://api.github.com/repos/whitepiolin/JavaScript3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/whitepiolin/JavaScript3/merges","archive_url":"https://api.github.com/repos/whitepiolin/JavaScript3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/whitepiolin/JavaScript3/downloads","issues_url":"https://api.github.com/repos/whitepiolin/JavaScript3/issues{/number}","pulls_url":"https://api.github.com/repos/whitepiolin/JavaScript3/pulls{/number}","milestones_url":"https://api.github.com/repos/whitepiolin/JavaScript3/milestones{/number}","notifications_url":"https://api.github.com/repos/whitepiolin/JavaScript3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/whitepiolin/JavaScript3/labels{/name}","releases_url":"https://api.github.com/repos/whitepiolin/JavaScript3/releases{/id}","deployments_url":"https://api.github.com/repos/whitepiolin/JavaScript3/deployments","created_at":"2018-08-30T17:08:24Z","updated_at":"2018-08-30T17:08:26Z","pushed_at":"2018-09-01T18:46:39Z","git_url":"git://github.com/whitepiolin/JavaScript3.git","ssh_url":"git@github.com:whitepiolin/JavaScript3.git","clone_url":"https://github.com/whitepiolin/JavaScript3.git","svn_url":"https://github.com/whitepiolin/JavaScript3","homepage":null,"size":11281,"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":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"HackYourFuture:master","ref":"master","sha":"da506b538c22c7b7f012331ba935d9a4335baf8c","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","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},"private":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-08-17T10:02:21Z","pushed_at":"2018-09-03T07:37:31Z","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":11281,"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":43,"mirror_url":null,"archived":false,"open_issues_count":38,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":43,"open_issues":38,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81"},"html":{"href":"https://github.com/HackYourFuture/JavaScript3/pull/81"},"issue":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/81"},"comments":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/issues/81/comments"},"review_comments":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81/comments"},"review_comment":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/pulls/81/commits"},"statuses":{"href":"https://api.github.com/repos/HackYourFuture/JavaScript3/statuses/bd091f4e68d64ec8c0a54b174a4fc77f643ee870"}},"author_association":"NONE"}}
{"actor":{"display_login":"whitepiolin"}}