{"action":"created","comment":{"url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/comments/36499802","id":36499802,"diff_hunk":"@@ -0,0 +1,82 @@\n+(function(sc) {\n+    'use strict';\n+    sc.data.feed.coinbase.websocket = function() {\n+        var product = 'BTC-USD';\n+        var msgType = 'match';\n+        var coinbaseSocket = null;\n+        var callback = null; // not sure we want to be storing things like this?\n+\n+        function websocket(cb) {\n+            coinbaseSocket = new WebSocket('wss://ws-feed.exchange.coinbase.com');\n+            var msg = {\n+                type: 'subscribe',\n+                'product_id': product\n+            };\n+\n+            callback = cb;\n+\n+            coinbaseSocket.onopen = function() {\n+                coinbaseSocket.send(JSON.stringify(msg));\n+            };\n+\n+            coinbaseSocket.onmessage = function(event) {\n+                var messageData = JSON.parse(event.data);\n+                if (messageData.type === msgType) {\n+                    var datum = {};\n+                    datum.date = new Date(messageData.time);\n+                    datum.price = parseFloat(messageData.price);\n+                    datum.volume = parseFloat(messageData.size);\n+                    cb(null, datum);\n+                }\n+            };\n+\n+            coinbaseSocket.onerror = function(event) {\n+                cb(event, null);\n+            };\n+\n+            coinbaseSocket.onclose = function(event) {\n+                cb(event, null);\n+            };\n+\n+        }\n+\n+        websocket.close = function() {\n+            if (coinbaseSocket) {\n+                if (coinbaseSocket.readyState === 1) {\n+                    coinbaseSocket.close();\n+                }\n+            }\n+        };\n+\n+        websocket.msgType = function(x) {\n+            if (!arguments.length) {\n+                return msgType;\n+            }\n+            msgType = x;\n+            return websocket;\n+        };\n+\n+        websocket.product = function(x) {\n+            if (!arguments.length) {\n+                return product;\n+            }\n+            product = x;\n+            return websocket;\n+        };\n+\n+        websocket.getProductList = function(cb) {\n+            d3.json('https://api.exchange.coinbase.com/products/', function(err, data) {\n+                // jscs:disable","path":"src/assets/js/websocket.js","position":67,"original_position":69,"commit_id":"f315b6e6749bb4757a99c5be773836fc6e579382","original_commit_id":"76c01dcc1781c7a511f351905dad92ddb23df926","user":{"login":"jleft","id":2017615,"avatar_url":"https://avatars.githubusercontent.com/u/2017615?v=3","gravatar_id":"","url":"https://api.github.com/users/jleft","html_url":"https://github.com/jleft","followers_url":"https://api.github.com/users/jleft/followers","following_url":"https://api.github.com/users/jleft/following{/other_user}","gists_url":"https://api.github.com/users/jleft/gists{/gist_id}","starred_url":"https://api.github.com/users/jleft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jleft/subscriptions","organizations_url":"https://api.github.com/users/jleft/orgs","repos_url":"https://api.github.com/users/jleft/repos","events_url":"https://api.github.com/users/jleft/events{/privacy}","received_events_url":"https://api.github.com/users/jleft/received_events","type":"User","site_admin":false},"body":"> Do you want to disable the specific rule throughout the whole project?\r\n\r\nNo, I was thinking we could just disable the specific rule (not sure which rule it is!) here:\r\n\r\n```js\r\n// jscs:disable specificRule\r\nvar productList = data.map(function(product) { return product.display_name; });\r\n// jscs:enable specificRule","created_at":"2015-08-07T08:28:30Z","updated_at":"2015-08-07T08:28:30Z","html_url":"https://github.com/ScottLogic/d3fc-showcase/pull/55#discussion_r36499802","pull_request_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55","_links":{"self":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/comments/36499802"},"html":{"href":"https://github.com/ScottLogic/d3fc-showcase/pull/55#discussion_r36499802"},"pull_request":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55"}}},"pull_request":{"url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55","id":41778727,"html_url":"https://github.com/ScottLogic/d3fc-showcase/pull/55","diff_url":"https://github.com/ScottLogic/d3fc-showcase/pull/55.diff","patch_url":"https://github.com/ScottLogic/d3fc-showcase/pull/55.patch","issue_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues/55","number":55,"state":"open","locked":false,"title":"Added websocket and OHLC converter","user":{"login":"CBarrett2","id":12998688,"avatar_url":"https://avatars.githubusercontent.com/u/12998688?v=3","gravatar_id":"","url":"https://api.github.com/users/CBarrett2","html_url":"https://github.com/CBarrett2","followers_url":"https://api.github.com/users/CBarrett2/followers","following_url":"https://api.github.com/users/CBarrett2/following{/other_user}","gists_url":"https://api.github.com/users/CBarrett2/gists{/gist_id}","starred_url":"https://api.github.com/users/CBarrett2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBarrett2/subscriptions","organizations_url":"https://api.github.com/users/CBarrett2/orgs","repos_url":"https://api.github.com/users/CBarrett2/repos","events_url":"https://api.github.com/users/CBarrett2/events{/privacy}","received_events_url":"https://api.github.com/users/CBarrett2/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-06T11:44:02Z","updated_at":"2015-08-07T08:28:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"de01fd9e78b2089b21fb116ee6953ef0a20dffcc","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55/commits","review_comments_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55/comments","review_comment_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues/55/comments","statuses_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/statuses/f315b6e6749bb4757a99c5be773836fc6e579382","head":{"label":"CBarrett2:feature/websocket","ref":"feature/websocket","sha":"f315b6e6749bb4757a99c5be773836fc6e579382","user":{"login":"CBarrett2","id":12998688,"avatar_url":"https://avatars.githubusercontent.com/u/12998688?v=3","gravatar_id":"","url":"https://api.github.com/users/CBarrett2","html_url":"https://github.com/CBarrett2","followers_url":"https://api.github.com/users/CBarrett2/followers","following_url":"https://api.github.com/users/CBarrett2/following{/other_user}","gists_url":"https://api.github.com/users/CBarrett2/gists{/gist_id}","starred_url":"https://api.github.com/users/CBarrett2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBarrett2/subscriptions","organizations_url":"https://api.github.com/users/CBarrett2/orgs","repos_url":"https://api.github.com/users/CBarrett2/repos","events_url":"https://api.github.com/users/CBarrett2/events{/privacy}","received_events_url":"https://api.github.com/users/CBarrett2/received_events","type":"User","site_admin":false},"repo":{"id":39068757,"name":"d3fc-showcase","full_name":"CBarrett2/d3fc-showcase","owner":{"login":"CBarrett2","id":12998688,"avatar_url":"https://avatars.githubusercontent.com/u/12998688?v=3","gravatar_id":"","url":"https://api.github.com/users/CBarrett2","html_url":"https://github.com/CBarrett2","followers_url":"https://api.github.com/users/CBarrett2/followers","following_url":"https://api.github.com/users/CBarrett2/following{/other_user}","gists_url":"https://api.github.com/users/CBarrett2/gists{/gist_id}","starred_url":"https://api.github.com/users/CBarrett2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CBarrett2/subscriptions","organizations_url":"https://api.github.com/users/CBarrett2/orgs","repos_url":"https://api.github.com/users/CBarrett2/repos","events_url":"https://api.github.com/users/CBarrett2/events{/privacy}","received_events_url":"https://api.github.com/users/CBarrett2/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CBarrett2/d3fc-showcase","description":"My clone of the development branch","fork":true,"url":"https://api.github.com/repos/CBarrett2/d3fc-showcase","forks_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/forks","keys_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/teams","hooks_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/hooks","issue_events_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/issues/events{/number}","events_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/events","assignees_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/assignees{/user}","branches_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/branches{/branch}","tags_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/tags","blobs_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/git/refs{/sha}","trees_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/statuses/{sha}","languages_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/languages","stargazers_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/stargazers","contributors_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/contributors","subscribers_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/subscribers","subscription_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/subscription","commits_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/commits{/sha}","git_commits_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/git/commits{/sha}","comments_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/comments{/number}","issue_comment_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/issues/comments{/number}","contents_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/contents/{+path}","compare_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/merges","archive_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/downloads","issues_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/issues{/number}","pulls_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/pulls{/number}","milestones_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/milestones{/number}","notifications_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/labels{/name}","releases_url":"https://api.github.com/repos/CBarrett2/d3fc-showcase/releases{/id}","created_at":"2015-07-14T10:32:06Z","updated_at":"2015-07-14T10:32:21Z","pushed_at":"2015-08-06T16:02:58Z","git_url":"git://github.com/CBarrett2/d3fc-showcase.git","ssh_url":"git@github.com:CBarrett2/d3fc-showcase.git","clone_url":"https://github.com/CBarrett2/d3fc-showcase.git","svn_url":"https://github.com/CBarrett2/d3fc-showcase","homepage":"","size":444,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ScottLogic:develop","ref":"develop","sha":"a59bfb735d0f343301e328bce953afe5147a0eb3","user":{"login":"ScottLogic","id":2046037,"avatar_url":"https://avatars.githubusercontent.com/u/2046037?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottLogic","html_url":"https://github.com/ScottLogic","followers_url":"https://api.github.com/users/ScottLogic/followers","following_url":"https://api.github.com/users/ScottLogic/following{/other_user}","gists_url":"https://api.github.com/users/ScottLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottLogic/subscriptions","organizations_url":"https://api.github.com/users/ScottLogic/orgs","repos_url":"https://api.github.com/users/ScottLogic/repos","events_url":"https://api.github.com/users/ScottLogic/events{/privacy}","received_events_url":"https://api.github.com/users/ScottLogic/received_events","type":"Organization","site_admin":false},"repo":{"id":39064095,"name":"d3fc-showcase","full_name":"ScottLogic/d3fc-showcase","owner":{"login":"ScottLogic","id":2046037,"avatar_url":"https://avatars.githubusercontent.com/u/2046037?v=3","gravatar_id":"","url":"https://api.github.com/users/ScottLogic","html_url":"https://github.com/ScottLogic","followers_url":"https://api.github.com/users/ScottLogic/followers","following_url":"https://api.github.com/users/ScottLogic/following{/other_user}","gists_url":"https://api.github.com/users/ScottLogic/gists{/gist_id}","starred_url":"https://api.github.com/users/ScottLogic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ScottLogic/subscriptions","organizations_url":"https://api.github.com/users/ScottLogic/orgs","repos_url":"https://api.github.com/users/ScottLogic/repos","events_url":"https://api.github.com/users/ScottLogic/events{/privacy}","received_events_url":"https://api.github.com/users/ScottLogic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ScottLogic/d3fc-showcase","description":"A cross-platform financial charting application to showcase the functionality of d3fc components.","fork":false,"url":"https://api.github.com/repos/ScottLogic/d3fc-showcase","forks_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/forks","keys_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/teams","hooks_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/hooks","issue_events_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues/events{/number}","events_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/events","assignees_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/assignees{/user}","branches_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/branches{/branch}","tags_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/tags","blobs_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/git/refs{/sha}","trees_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/statuses/{sha}","languages_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/languages","stargazers_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/stargazers","contributors_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/contributors","subscribers_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/subscribers","subscription_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/subscription","commits_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/commits{/sha}","git_commits_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/git/commits{/sha}","comments_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/comments{/number}","issue_comment_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues/comments{/number}","contents_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/contents/{+path}","compare_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/merges","archive_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/downloads","issues_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues{/number}","pulls_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls{/number}","milestones_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/milestones{/number}","notifications_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/labels{/name}","releases_url":"https://api.github.com/repos/ScottLogic/d3fc-showcase/releases{/id}","created_at":"2015-07-14T08:47:46Z","updated_at":"2015-07-29T08:24:11Z","pushed_at":"2015-08-06T16:02:58Z","git_url":"git://github.com/ScottLogic/d3fc-showcase.git","ssh_url":"git@github.com:ScottLogic/d3fc-showcase.git","clone_url":"https://github.com/ScottLogic/d3fc-showcase.git","svn_url":"https://github.com/ScottLogic/d3fc-showcase","homepage":"","size":924,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":12,"forks":5,"open_issues":12,"watchers":2,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55"},"html":{"href":"https://github.com/ScottLogic/d3fc-showcase/pull/55"},"issue":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues/55"},"comments":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/issues/55/comments"},"review_comments":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55/comments"},"review_comment":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/pulls/55/commits"},"statuses":{"href":"https://api.github.com/repos/ScottLogic/d3fc-showcase/statuses/f315b6e6749bb4757a99c5be773836fc6e579382"}}}}