{"action":"created","comment":{"url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/comments/184596137","pull_request_review_id":115824653,"id":184596137,"diff_hunk":"@@ -0,0 +1,175 @@\n+// Utils\n+import {\n+  fetchHandler,\n+  requiredParam,\n+  serializeUrlParams\n+} from 'util/index.js';\n+\n+const defaults = {\n+  format: 'json',\n+  url: 'https://cors-anywhere.herokuapp.com/https://api.musixmatch.com/ws/1.1/'\n+};\n+\n+/**\n+ * @method extractResponseBody\n+ * @description Unpack data from most musixmatch APIs\n+ * @param {Promise} promise\n+ * @returns {Object}\n+ */\n+const extractResponseBody = promise => promise\n+  .then(response => response.message.body);\n+\n+class MusixmatchProvider {\n+\n+  constructor (options) {\n+    this.options = {\n+      ...defaults,\n+      ...options\n+    };\n+  }\n+\n+  /**\n+   * @method getRoute\n+   * @description Composes a musixmatch route, including authorization\n+   * @returns {String}\n+   */\n+  getRoute = ({\n+    method = requiredParam('method'),\n+    params = {}\n+  }) => {\n+    const urlParams = serializeUrlParams({\n+      apikey: this.options.apiKey,\n+      format: this.options.format,\n+      ...params\n+    });\n+    return `${this.options.url}${method}?${urlParams}`;\n+  }\n+\n+  /**\n+   * @method getTrackLyrics\n+   * @returns {Promise}\n+   */\n+  getTrackLyrics = ({\n+    track_id = requiredParam('track_id')\n+  } = {}) => {\n+    const route = this.getRoute({\n+      method: 'track.lyrics.get',\n+      params: {\n+        track_id\n+      }\n+    });\n+\n+    let promise = fetch(route);\n+    promise = fetchHandler(promise);\n+    promise = extractResponseBody(promise);\n+    return promise;\n+  }\n+\n+  /**\n+   * @method searchArtist\n+   * @returns {Promise}\n+   */\n+  searchArtist = ({\n+    q_artist = requiredParam('q_artist'),\n+    page_size = 3\n+  } = {}) => {\n+    const route = this.getRoute({\n+      method: 'artist.search',\n+      params: {\n+        q_artist,\n+        page_size\n+      }\n+    });\n+\n+    let promise = fetch(route);\n+    promise = fetchHandler(promise);\n+    promise = extractResponseBody(promise);\n+    return promise;\n+  }\n+\n+  /**\n+   * @method searchTracksByArtist\n+   * @returns {Promise}\n+   */\n+  searchTracksByArtist = ({\n+    f_artist_id = requiredParam('f_artist_id'),\n+    page_size = 12\n+  } = {}) => {\n+    const route = this.getRoute({\n+      method: 'track.search',\n+      params: {\n+        f_artist_id,\n+        s_track_rating: 'desc',\n+        page_size\n+      }\n+    });\n+\n+    let promise = fetch(route);\n+    promise = fetchHandler(promise);\n+    promise = extractResponseBody(promise);\n+    return promise;\n+  }\n+\n+  // /**","path":"uiux/challenge-1/src/api/musixmatch/provider.js","position":113,"original_position":113,"commit_id":"bf981d416404ec968fac75d7ad062ffa1ff38fe5","original_commit_id":"bf981d416404ec968fac75d7ad062ffa1ff38fe5","user":{"login":"calamitoso","id":5287373,"avatar_url":"https://avatars0.githubusercontent.com/u/5287373?v=4","gravatar_id":"","url":"https://api.github.com/users/calamitoso","html_url":"https://github.com/calamitoso","followers_url":"https://api.github.com/users/calamitoso/followers","following_url":"https://api.github.com/users/calamitoso/following{/other_user}","gists_url":"https://api.github.com/users/calamitoso/gists{/gist_id}","starred_url":"https://api.github.com/users/calamitoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calamitoso/subscriptions","organizations_url":"https://api.github.com/users/calamitoso/orgs","repos_url":"https://api.github.com/users/calamitoso/repos","events_url":"https://api.github.com/users/calamitoso/events{/privacy}","received_events_url":"https://api.github.com/users/calamitoso/received_events","type":"User","site_admin":false},"body":"These are the remains of an idea for an alternate navigation path","created_at":"2018-04-27T05:38:58Z","updated_at":"2018-04-27T05:50:40Z","html_url":"https://github.com/b-yond-infinite-network/amaze-us/pull/8#discussion_r184596137","pull_request_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/comments/184596137"},"html":{"href":"https://github.com/b-yond-infinite-network/amaze-us/pull/8#discussion_r184596137"},"pull_request":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8","id":184525280,"html_url":"https://github.com/b-yond-infinite-network/amaze-us/pull/8","diff_url":"https://github.com/b-yond-infinite-network/amaze-us/pull/8.diff","patch_url":"https://github.com/b-yond-infinite-network/amaze-us/pull/8.patch","issue_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues/8","number":8,"state":"open","locked":false,"title":"Nicolas","user":{"login":"calamitoso","id":5287373,"avatar_url":"https://avatars0.githubusercontent.com/u/5287373?v=4","gravatar_id":"","url":"https://api.github.com/users/calamitoso","html_url":"https://github.com/calamitoso","followers_url":"https://api.github.com/users/calamitoso/followers","following_url":"https://api.github.com/users/calamitoso/following{/other_user}","gists_url":"https://api.github.com/users/calamitoso/gists{/gist_id}","starred_url":"https://api.github.com/users/calamitoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calamitoso/subscriptions","organizations_url":"https://api.github.com/users/calamitoso/orgs","repos_url":"https://api.github.com/users/calamitoso/repos","events_url":"https://api.github.com/users/calamitoso/events{/privacy}","received_events_url":"https://api.github.com/users/calamitoso/received_events","type":"User","site_admin":false},"body":"@bruno-morel Hey Bruno! Here it is. I'll leave some comments in the code, but please ask any questions you might have\r\n\r\nSince I based my work on a Create React App setup, you'll see here a bunch of CRA files that I did not touch; here is a[ good diff ](https://github.com/calamitoso/amaze-us/compare/e41f29...bf981d?expand=1) focusing on the code I actually wrote.\r\n\r\nI have deployed the app here https://calamitoso.github.io/amaze-us/\r\n\r\nA good point to begin is the README here https://github.com/calamitoso/amaze-us/tree/nicolas/uiux/challenge-1\r\n\r\nEnjoy!","created_at":"2018-04-27T05:09:49Z","updated_at":"2018-04-27T05:50:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"410fdefc3f9f3fe3461baae1d1c07e4da77c9fb1","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8/commits","review_comments_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8/comments","review_comment_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/comments{/number}","comments_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues/8/comments","statuses_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/statuses/bf981d416404ec968fac75d7ad062ffa1ff38fe5","head":{"label":"calamitoso:nicolas","ref":"nicolas","sha":"bf981d416404ec968fac75d7ad062ffa1ff38fe5","user":{"login":"calamitoso","id":5287373,"avatar_url":"https://avatars0.githubusercontent.com/u/5287373?v=4","gravatar_id":"","url":"https://api.github.com/users/calamitoso","html_url":"https://github.com/calamitoso","followers_url":"https://api.github.com/users/calamitoso/followers","following_url":"https://api.github.com/users/calamitoso/following{/other_user}","gists_url":"https://api.github.com/users/calamitoso/gists{/gist_id}","starred_url":"https://api.github.com/users/calamitoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calamitoso/subscriptions","organizations_url":"https://api.github.com/users/calamitoso/orgs","repos_url":"https://api.github.com/users/calamitoso/repos","events_url":"https://api.github.com/users/calamitoso/events{/privacy}","received_events_url":"https://api.github.com/users/calamitoso/received_events","type":"User","site_admin":false},"repo":{"id":131110319,"name":"amaze-us","full_name":"calamitoso/amaze-us","owner":{"login":"calamitoso","id":5287373,"avatar_url":"https://avatars0.githubusercontent.com/u/5287373?v=4","gravatar_id":"","url":"https://api.github.com/users/calamitoso","html_url":"https://github.com/calamitoso","followers_url":"https://api.github.com/users/calamitoso/followers","following_url":"https://api.github.com/users/calamitoso/following{/other_user}","gists_url":"https://api.github.com/users/calamitoso/gists{/gist_id}","starred_url":"https://api.github.com/users/calamitoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calamitoso/subscriptions","organizations_url":"https://api.github.com/users/calamitoso/orgs","repos_url":"https://api.github.com/users/calamitoso/repos","events_url":"https://api.github.com/users/calamitoso/events{/privacy}","received_events_url":"https://api.github.com/users/calamitoso/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calamitoso/amaze-us","description":"A repository to demonstrate amazingness","fork":true,"url":"https://api.github.com/repos/calamitoso/amaze-us","forks_url":"https://api.github.com/repos/calamitoso/amaze-us/forks","keys_url":"https://api.github.com/repos/calamitoso/amaze-us/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calamitoso/amaze-us/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calamitoso/amaze-us/teams","hooks_url":"https://api.github.com/repos/calamitoso/amaze-us/hooks","issue_events_url":"https://api.github.com/repos/calamitoso/amaze-us/issues/events{/number}","events_url":"https://api.github.com/repos/calamitoso/amaze-us/events","assignees_url":"https://api.github.com/repos/calamitoso/amaze-us/assignees{/user}","branches_url":"https://api.github.com/repos/calamitoso/amaze-us/branches{/branch}","tags_url":"https://api.github.com/repos/calamitoso/amaze-us/tags","blobs_url":"https://api.github.com/repos/calamitoso/amaze-us/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calamitoso/amaze-us/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calamitoso/amaze-us/git/refs{/sha}","trees_url":"https://api.github.com/repos/calamitoso/amaze-us/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calamitoso/amaze-us/statuses/{sha}","languages_url":"https://api.github.com/repos/calamitoso/amaze-us/languages","stargazers_url":"https://api.github.com/repos/calamitoso/amaze-us/stargazers","contributors_url":"https://api.github.com/repos/calamitoso/amaze-us/contributors","subscribers_url":"https://api.github.com/repos/calamitoso/amaze-us/subscribers","subscription_url":"https://api.github.com/repos/calamitoso/amaze-us/subscription","commits_url":"https://api.github.com/repos/calamitoso/amaze-us/commits{/sha}","git_commits_url":"https://api.github.com/repos/calamitoso/amaze-us/git/commits{/sha}","comments_url":"https://api.github.com/repos/calamitoso/amaze-us/comments{/number}","issue_comment_url":"https://api.github.com/repos/calamitoso/amaze-us/issues/comments{/number}","contents_url":"https://api.github.com/repos/calamitoso/amaze-us/contents/{+path}","compare_url":"https://api.github.com/repos/calamitoso/amaze-us/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calamitoso/amaze-us/merges","archive_url":"https://api.github.com/repos/calamitoso/amaze-us/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calamitoso/amaze-us/downloads","issues_url":"https://api.github.com/repos/calamitoso/amaze-us/issues{/number}","pulls_url":"https://api.github.com/repos/calamitoso/amaze-us/pulls{/number}","milestones_url":"https://api.github.com/repos/calamitoso/amaze-us/milestones{/number}","notifications_url":"https://api.github.com/repos/calamitoso/amaze-us/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calamitoso/amaze-us/labels{/name}","releases_url":"https://api.github.com/repos/calamitoso/amaze-us/releases{/id}","deployments_url":"https://api.github.com/repos/calamitoso/amaze-us/deployments","created_at":"2018-04-26T06:30:22Z","updated_at":"2018-04-26T06:37:28Z","pushed_at":"2018-04-27T05:29:00Z","git_url":"git://github.com/calamitoso/amaze-us.git","ssh_url":"git@github.com:calamitoso/amaze-us.git","clone_url":"https://github.com/calamitoso/amaze-us.git","svn_url":"https://github.com/calamitoso/amaze-us","homepage":null,"size":227,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"b-yond-infinite-network:master","ref":"master","sha":"aa4f9bee3646931dcba84649c5dee627e36e5e53","user":{"login":"b-yond-infinite-network","id":34663089,"avatar_url":"https://avatars0.githubusercontent.com/u/34663089?v=4","gravatar_id":"","url":"https://api.github.com/users/b-yond-infinite-network","html_url":"https://github.com/b-yond-infinite-network","followers_url":"https://api.github.com/users/b-yond-infinite-network/followers","following_url":"https://api.github.com/users/b-yond-infinite-network/following{/other_user}","gists_url":"https://api.github.com/users/b-yond-infinite-network/gists{/gist_id}","starred_url":"https://api.github.com/users/b-yond-infinite-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b-yond-infinite-network/subscriptions","organizations_url":"https://api.github.com/users/b-yond-infinite-network/orgs","repos_url":"https://api.github.com/users/b-yond-infinite-network/repos","events_url":"https://api.github.com/users/b-yond-infinite-network/events{/privacy}","received_events_url":"https://api.github.com/users/b-yond-infinite-network/received_events","type":"Organization","site_admin":false},"repo":{"id":122511107,"name":"amaze-us","full_name":"b-yond-infinite-network/amaze-us","owner":{"login":"b-yond-infinite-network","id":34663089,"avatar_url":"https://avatars0.githubusercontent.com/u/34663089?v=4","gravatar_id":"","url":"https://api.github.com/users/b-yond-infinite-network","html_url":"https://github.com/b-yond-infinite-network","followers_url":"https://api.github.com/users/b-yond-infinite-network/followers","following_url":"https://api.github.com/users/b-yond-infinite-network/following{/other_user}","gists_url":"https://api.github.com/users/b-yond-infinite-network/gists{/gist_id}","starred_url":"https://api.github.com/users/b-yond-infinite-network/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b-yond-infinite-network/subscriptions","organizations_url":"https://api.github.com/users/b-yond-infinite-network/orgs","repos_url":"https://api.github.com/users/b-yond-infinite-network/repos","events_url":"https://api.github.com/users/b-yond-infinite-network/events{/privacy}","received_events_url":"https://api.github.com/users/b-yond-infinite-network/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/b-yond-infinite-network/amaze-us","description":"A repository to demonstrate amazingness","fork":false,"url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us","forks_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/forks","keys_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/keys{/key_id}","collaborators_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/teams","hooks_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/hooks","issue_events_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues/events{/number}","events_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/events","assignees_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/assignees{/user}","branches_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/branches{/branch}","tags_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/tags","blobs_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/git/refs{/sha}","trees_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/git/trees{/sha}","statuses_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/statuses/{sha}","languages_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/languages","stargazers_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/stargazers","contributors_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/contributors","subscribers_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/subscribers","subscription_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/subscription","commits_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/commits{/sha}","git_commits_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/git/commits{/sha}","comments_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/comments{/number}","issue_comment_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues/comments{/number}","contents_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/contents/{+path}","compare_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/compare/{base}...{head}","merges_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/merges","archive_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/downloads","issues_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues{/number}","pulls_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls{/number}","milestones_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/milestones{/number}","notifications_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/labels{/name}","releases_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/releases{/id}","deployments_url":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/deployments","created_at":"2018-02-22T17:25:29Z","updated_at":"2018-03-08T23:09:20Z","pushed_at":"2018-04-27T05:09:50Z","git_url":"git://github.com/b-yond-infinite-network/amaze-us.git","ssh_url":"git@github.com:b-yond-infinite-network/amaze-us.git","clone_url":"https://github.com/b-yond-infinite-network/amaze-us.git","svn_url":"https://github.com/b-yond-infinite-network/amaze-us","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":8,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8"},"html":{"href":"https://github.com/b-yond-infinite-network/amaze-us/pull/8"},"issue":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues/8"},"comments":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/b-yond-infinite-network/amaze-us/statuses/bf981d416404ec968fac75d7ad062ffa1ff38fe5"}},"author_association":"NONE"}}
{"actor":{"display_login":"calamitoso"}}