{"action":"created","comment":{"url":"https://api.github.com/repos/ga-ladder/chat-space/pulls/comments/197609548","pull_request_review_id":131392197,"id":197609548,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzYwOTU0OA==","diff_hunk":"@@ -42,4 +42,33 @@ $(function() {\n       $('.form__submit').attr('disabled',false);\n     })\n   });\n+\n+  function update(){\n+    $.ajax({\n+      url: '',\n+      dataType: 'json',\n+      processData: false,\n+      contentType: false\n+    })\n+    .done(function(data){\n+      id = $('.message:last').attr('id');\n+      console.log(id)\n+      data.messages.forEach(function(message) {\n+        if ( message.id > id) {\n+          var html = buildHTML(message);\n+          $('.messages').append(html);\n+          $('html, body').animate({scrollTop: $('.messages').height()});","path":"app/assets/javascripts/message.js","position":28,"original_position":28,"commit_id":"3dc6f83e9e9e20638a42f2ad2f2dd27f8a2ab06b","original_commit_id":"3dc6f83e9e9e20638a42f2ad2f2dd27f8a2ab06b","user":{"login":"MrUrakou","id":18899359,"node_id":"MDQ6VXNlcjE4ODk5MzU5","avatar_url":"https://avatars1.githubusercontent.com/u/18899359?v=4","gravatar_id":"","url":"https://api.github.com/users/MrUrakou","html_url":"https://github.com/MrUrakou","followers_url":"https://api.github.com/users/MrUrakou/followers","following_url":"https://api.github.com/users/MrUrakou/following{/other_user}","gists_url":"https://api.github.com/users/MrUrakou/gists{/gist_id}","starred_url":"https://api.github.com/users/MrUrakou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrUrakou/subscriptions","organizations_url":"https://api.github.com/users/MrUrakou/orgs","repos_url":"https://api.github.com/users/MrUrakou/repos","events_url":"https://api.github.com/users/MrUrakou/events{/privacy}","received_events_url":"https://api.github.com/users/MrUrakou/received_events","type":"User","site_admin":false},"body":"スクロールする機能は関数化して必要なところで呼び出せば、可読性も上がるし、使い回しもできます。","created_at":"2018-06-23T11:26:20Z","updated_at":"2018-06-23T11:28:29Z","html_url":"https://github.com/ga-ladder/chat-space/pull/8#discussion_r197609548","pull_request_url":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ga-ladder/chat-space/pulls/comments/197609548"},"html":{"href":"https://github.com/ga-ladder/chat-space/pull/8#discussion_r197609548"},"pull_request":{"href":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8"}}},"pull_request":{"url":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8","id":196622126,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2NjIyMTI2","html_url":"https://github.com/ga-ladder/chat-space/pull/8","diff_url":"https://github.com/ga-ladder/chat-space/pull/8.diff","patch_url":"https://github.com/ga-ladder/chat-space/pull/8.patch","issue_url":"https://api.github.com/repos/ga-ladder/chat-space/issues/8","number":8,"state":"open","locked":false,"title":"自動更新機能の実装","user":{"login":"ga-ladder","id":8581682,"node_id":"MDQ6VXNlcjg1ODE2ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/8581682?v=4","gravatar_id":"","url":"https://api.github.com/users/ga-ladder","html_url":"https://github.com/ga-ladder","followers_url":"https://api.github.com/users/ga-ladder/followers","following_url":"https://api.github.com/users/ga-ladder/following{/other_user}","gists_url":"https://api.github.com/users/ga-ladder/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-ladder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-ladder/subscriptions","organizations_url":"https://api.github.com/users/ga-ladder/orgs","repos_url":"https://api.github.com/users/ga-ladder/repos","events_url":"https://api.github.com/users/ga-ladder/events{/privacy}","received_events_url":"https://api.github.com/users/ga-ladder/received_events","type":"User","site_admin":false},"body":"### What\r\n５秒ごとに新しいメッセージがある確認して、あれば自動で非同期更新する。\r\n### Why\r\nメッセージのやり取りは短時間でなされるもの。\r\n自動更新機能があるとすぐに相手の返信を確認できて嬉しい。","created_at":"2018-06-22T02:21:07Z","updated_at":"2018-06-23T11:28:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9fe0109ca8cad4cdc7fe44332bd77d9032f6b16f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8/commits","review_comments_url":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8/comments","review_comment_url":"https://api.github.com/repos/ga-ladder/chat-space/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ga-ladder/chat-space/issues/8/comments","statuses_url":"https://api.github.com/repos/ga-ladder/chat-space/statuses/3dc6f83e9e9e20638a42f2ad2f2dd27f8a2ab06b","head":{"label":"ga-ladder:自動更新機能","ref":"自動更新機能","sha":"3dc6f83e9e9e20638a42f2ad2f2dd27f8a2ab06b","user":{"login":"ga-ladder","id":8581682,"node_id":"MDQ6VXNlcjg1ODE2ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/8581682?v=4","gravatar_id":"","url":"https://api.github.com/users/ga-ladder","html_url":"https://github.com/ga-ladder","followers_url":"https://api.github.com/users/ga-ladder/followers","following_url":"https://api.github.com/users/ga-ladder/following{/other_user}","gists_url":"https://api.github.com/users/ga-ladder/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-ladder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-ladder/subscriptions","organizations_url":"https://api.github.com/users/ga-ladder/orgs","repos_url":"https://api.github.com/users/ga-ladder/repos","events_url":"https://api.github.com/users/ga-ladder/events{/privacy}","received_events_url":"https://api.github.com/users/ga-ladder/received_events","type":"User","site_admin":false},"repo":{"id":132112208,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxMTIyMDg=","name":"chat-space","full_name":"ga-ladder/chat-space","owner":{"login":"ga-ladder","id":8581682,"node_id":"MDQ6VXNlcjg1ODE2ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/8581682?v=4","gravatar_id":"","url":"https://api.github.com/users/ga-ladder","html_url":"https://github.com/ga-ladder","followers_url":"https://api.github.com/users/ga-ladder/followers","following_url":"https://api.github.com/users/ga-ladder/following{/other_user}","gists_url":"https://api.github.com/users/ga-ladder/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-ladder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-ladder/subscriptions","organizations_url":"https://api.github.com/users/ga-ladder/orgs","repos_url":"https://api.github.com/users/ga-ladder/repos","events_url":"https://api.github.com/users/ga-ladder/events{/privacy}","received_events_url":"https://api.github.com/users/ga-ladder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ga-ladder/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/ga-ladder/chat-space","forks_url":"https://api.github.com/repos/ga-ladder/chat-space/forks","keys_url":"https://api.github.com/repos/ga-ladder/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-ladder/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-ladder/chat-space/teams","hooks_url":"https://api.github.com/repos/ga-ladder/chat-space/hooks","issue_events_url":"https://api.github.com/repos/ga-ladder/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/ga-ladder/chat-space/events","assignees_url":"https://api.github.com/repos/ga-ladder/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/ga-ladder/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/ga-ladder/chat-space/tags","blobs_url":"https://api.github.com/repos/ga-ladder/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-ladder/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-ladder/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-ladder/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-ladder/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-ladder/chat-space/languages","stargazers_url":"https://api.github.com/repos/ga-ladder/chat-space/stargazers","contributors_url":"https://api.github.com/repos/ga-ladder/chat-space/contributors","subscribers_url":"https://api.github.com/repos/ga-ladder/chat-space/subscribers","subscription_url":"https://api.github.com/repos/ga-ladder/chat-space/subscription","commits_url":"https://api.github.com/repos/ga-ladder/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-ladder/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-ladder/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-ladder/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-ladder/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/ga-ladder/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-ladder/chat-space/merges","archive_url":"https://api.github.com/repos/ga-ladder/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-ladder/chat-space/downloads","issues_url":"https://api.github.com/repos/ga-ladder/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/ga-ladder/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-ladder/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-ladder/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-ladder/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/ga-ladder/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/ga-ladder/chat-space/deployments","created_at":"2018-05-04T08:31:11Z","updated_at":"2018-06-19T08:47:50Z","pushed_at":"2018-06-22T02:21:07Z","git_url":"git://github.com/ga-ladder/chat-space.git","ssh_url":"git@github.com:ga-ladder/chat-space.git","clone_url":"https://github.com/ga-ladder/chat-space.git","svn_url":"https://github.com/ga-ladder/chat-space","homepage":null,"size":118,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"ga-ladder:master","ref":"master","sha":"b19ac5e0ab6e3d5ca6e4a706f05900f25df73b23","user":{"login":"ga-ladder","id":8581682,"node_id":"MDQ6VXNlcjg1ODE2ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/8581682?v=4","gravatar_id":"","url":"https://api.github.com/users/ga-ladder","html_url":"https://github.com/ga-ladder","followers_url":"https://api.github.com/users/ga-ladder/followers","following_url":"https://api.github.com/users/ga-ladder/following{/other_user}","gists_url":"https://api.github.com/users/ga-ladder/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-ladder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-ladder/subscriptions","organizations_url":"https://api.github.com/users/ga-ladder/orgs","repos_url":"https://api.github.com/users/ga-ladder/repos","events_url":"https://api.github.com/users/ga-ladder/events{/privacy}","received_events_url":"https://api.github.com/users/ga-ladder/received_events","type":"User","site_admin":false},"repo":{"id":132112208,"node_id":"MDEwOlJlcG9zaXRvcnkxMzIxMTIyMDg=","name":"chat-space","full_name":"ga-ladder/chat-space","owner":{"login":"ga-ladder","id":8581682,"node_id":"MDQ6VXNlcjg1ODE2ODI=","avatar_url":"https://avatars3.githubusercontent.com/u/8581682?v=4","gravatar_id":"","url":"https://api.github.com/users/ga-ladder","html_url":"https://github.com/ga-ladder","followers_url":"https://api.github.com/users/ga-ladder/followers","following_url":"https://api.github.com/users/ga-ladder/following{/other_user}","gists_url":"https://api.github.com/users/ga-ladder/gists{/gist_id}","starred_url":"https://api.github.com/users/ga-ladder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ga-ladder/subscriptions","organizations_url":"https://api.github.com/users/ga-ladder/orgs","repos_url":"https://api.github.com/users/ga-ladder/repos","events_url":"https://api.github.com/users/ga-ladder/events{/privacy}","received_events_url":"https://api.github.com/users/ga-ladder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ga-ladder/chat-space","description":null,"fork":false,"url":"https://api.github.com/repos/ga-ladder/chat-space","forks_url":"https://api.github.com/repos/ga-ladder/chat-space/forks","keys_url":"https://api.github.com/repos/ga-ladder/chat-space/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ga-ladder/chat-space/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ga-ladder/chat-space/teams","hooks_url":"https://api.github.com/repos/ga-ladder/chat-space/hooks","issue_events_url":"https://api.github.com/repos/ga-ladder/chat-space/issues/events{/number}","events_url":"https://api.github.com/repos/ga-ladder/chat-space/events","assignees_url":"https://api.github.com/repos/ga-ladder/chat-space/assignees{/user}","branches_url":"https://api.github.com/repos/ga-ladder/chat-space/branches{/branch}","tags_url":"https://api.github.com/repos/ga-ladder/chat-space/tags","blobs_url":"https://api.github.com/repos/ga-ladder/chat-space/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ga-ladder/chat-space/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ga-ladder/chat-space/git/refs{/sha}","trees_url":"https://api.github.com/repos/ga-ladder/chat-space/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ga-ladder/chat-space/statuses/{sha}","languages_url":"https://api.github.com/repos/ga-ladder/chat-space/languages","stargazers_url":"https://api.github.com/repos/ga-ladder/chat-space/stargazers","contributors_url":"https://api.github.com/repos/ga-ladder/chat-space/contributors","subscribers_url":"https://api.github.com/repos/ga-ladder/chat-space/subscribers","subscription_url":"https://api.github.com/repos/ga-ladder/chat-space/subscription","commits_url":"https://api.github.com/repos/ga-ladder/chat-space/commits{/sha}","git_commits_url":"https://api.github.com/repos/ga-ladder/chat-space/git/commits{/sha}","comments_url":"https://api.github.com/repos/ga-ladder/chat-space/comments{/number}","issue_comment_url":"https://api.github.com/repos/ga-ladder/chat-space/issues/comments{/number}","contents_url":"https://api.github.com/repos/ga-ladder/chat-space/contents/{+path}","compare_url":"https://api.github.com/repos/ga-ladder/chat-space/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ga-ladder/chat-space/merges","archive_url":"https://api.github.com/repos/ga-ladder/chat-space/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ga-ladder/chat-space/downloads","issues_url":"https://api.github.com/repos/ga-ladder/chat-space/issues{/number}","pulls_url":"https://api.github.com/repos/ga-ladder/chat-space/pulls{/number}","milestones_url":"https://api.github.com/repos/ga-ladder/chat-space/milestones{/number}","notifications_url":"https://api.github.com/repos/ga-ladder/chat-space/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ga-ladder/chat-space/labels{/name}","releases_url":"https://api.github.com/repos/ga-ladder/chat-space/releases{/id}","deployments_url":"https://api.github.com/repos/ga-ladder/chat-space/deployments","created_at":"2018-05-04T08:31:11Z","updated_at":"2018-06-19T08:47:50Z","pushed_at":"2018-06-22T02:21:07Z","git_url":"git://github.com/ga-ladder/chat-space.git","ssh_url":"git@github.com:ga-ladder/chat-space.git","clone_url":"https://github.com/ga-ladder/chat-space.git","svn_url":"https://github.com/ga-ladder/chat-space","homepage":null,"size":118,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8"},"html":{"href":"https://github.com/ga-ladder/chat-space/pull/8"},"issue":{"href":"https://api.github.com/repos/ga-ladder/chat-space/issues/8"},"comments":{"href":"https://api.github.com/repos/ga-ladder/chat-space/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/ga-ladder/chat-space/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ga-ladder/chat-space/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/ga-ladder/chat-space/statuses/3dc6f83e9e9e20638a42f2ad2f2dd27f8a2ab06b"}},"author_association":"OWNER"}}
{"actor":{"display_login":"MrUrakou"}}