{"action":"created","comment":{"url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/comments/192938203","pull_request_review_id":125809259,"id":192938203,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjkzODIwMw==","diff_hunk":"@@ -0,0 +1,26 @@\n+class Upload::ImageUpload\n+\n+  URL = 'https://api.imgur.com/3/image'.freeze\n+\n+  def self.upload(base64)\n+    auth_header = { Authorization: \"Client-ID #{ENV['Client_ID']}\" }\n+    post_image(auth_header, base64)\n+  end\n+\n+  private\n+    def self.post_image(auth_header, base64)\n+      http_client = HTTPClient.new\n+      body = { image: base64 }\n+      res = http_client.post(URI.parse(URL), body, auth_header)\n+      begin\n+        result_hash = JSON.load(res.body)\n+        raise ApplicationController::Exception, '保存に失敗しました' unless result_hash.dig('data', 'link')","path":"lib/upload/image_upload.rb","position":17,"original_position":17,"commit_id":"a6d34663f3e5afdee93071284319b45a9b5b09bb","original_commit_id":"a6d34663f3e5afdee93071284319b45a9b5b09bb","user":{"login":"khatamoto-cq","id":29110710,"node_id":"MDQ6VXNlcjI5MTEwNzEw","avatar_url":"https://avatars0.githubusercontent.com/u/29110710?v=4","gravatar_id":"","url":"https://api.github.com/users/khatamoto-cq","html_url":"https://github.com/khatamoto-cq","followers_url":"https://api.github.com/users/khatamoto-cq/followers","following_url":"https://api.github.com/users/khatamoto-cq/following{/other_user}","gists_url":"https://api.github.com/users/khatamoto-cq/gists{/gist_id}","starred_url":"https://api.github.com/users/khatamoto-cq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/khatamoto-cq/subscriptions","organizations_url":"https://api.github.com/users/khatamoto-cq/orgs","repos_url":"https://api.github.com/users/khatamoto-cq/repos","events_url":"https://api.github.com/users/khatamoto-cq/events{/privacy}","received_events_url":"https://api.github.com/users/khatamoto-cq/received_events","type":"User","site_admin":false},"body":"この例外は無いはずなので実行エラー起こすんじゃないかな。","created_at":"2018-06-05T03:40:02Z","updated_at":"2018-06-05T03:51:07Z","html_url":"https://github.com/ksunaga-cq/BookServer/pull/1#discussion_r192938203","pull_request_url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/comments/192938203"},"html":{"href":"https://github.com/ksunaga-cq/BookServer/pull/1#discussion_r192938203"},"pull_request":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1","id":190486538,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNDg2NTM4","html_url":"https://github.com/ksunaga-cq/BookServer/pull/1","diff_url":"https://github.com/ksunaga-cq/BookServer/pull/1.diff","patch_url":"https://github.com/ksunaga-cq/BookServer/pull/1.patch","issue_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/1","number":1,"state":"open","locked":false,"title":"BookServerの実装","user":{"login":"ksunaga-cq","id":36253986,"node_id":"MDQ6VXNlcjM2MjUzOTg2","avatar_url":"https://avatars0.githubusercontent.com/u/36253986?v=4","gravatar_id":"","url":"https://api.github.com/users/ksunaga-cq","html_url":"https://github.com/ksunaga-cq","followers_url":"https://api.github.com/users/ksunaga-cq/followers","following_url":"https://api.github.com/users/ksunaga-cq/following{/other_user}","gists_url":"https://api.github.com/users/ksunaga-cq/gists{/gist_id}","starred_url":"https://api.github.com/users/ksunaga-cq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksunaga-cq/subscriptions","organizations_url":"https://api.github.com/users/ksunaga-cq/orgs","repos_url":"https://api.github.com/users/ksunaga-cq/repos","events_url":"https://api.github.com/users/ksunaga-cq/events{/privacy}","received_events_url":"https://api.github.com/users/ksunaga-cq/received_events","type":"User","site_admin":false},"body":"BookServerを実装しました。\r\nPRよろしくお願い致します。","created_at":"2018-05-25T05:40:33Z","updated_at":"2018-06-05T03:51:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d46cd18c29541e12ef4be17d69d56da41cfee93e","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1/commits","review_comments_url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1/comments","review_comment_url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/1/comments","statuses_url":"https://api.github.com/repos/ksunaga-cq/BookServer/statuses/a6d34663f3e5afdee93071284319b45a9b5b09bb","head":{"label":"ksunaga-cq:develop","ref":"develop","sha":"a6d34663f3e5afdee93071284319b45a9b5b09bb","user":{"login":"ksunaga-cq","id":36253986,"node_id":"MDQ6VXNlcjM2MjUzOTg2","avatar_url":"https://avatars0.githubusercontent.com/u/36253986?v=4","gravatar_id":"","url":"https://api.github.com/users/ksunaga-cq","html_url":"https://github.com/ksunaga-cq","followers_url":"https://api.github.com/users/ksunaga-cq/followers","following_url":"https://api.github.com/users/ksunaga-cq/following{/other_user}","gists_url":"https://api.github.com/users/ksunaga-cq/gists{/gist_id}","starred_url":"https://api.github.com/users/ksunaga-cq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksunaga-cq/subscriptions","organizations_url":"https://api.github.com/users/ksunaga-cq/orgs","repos_url":"https://api.github.com/users/ksunaga-cq/repos","events_url":"https://api.github.com/users/ksunaga-cq/events{/privacy}","received_events_url":"https://api.github.com/users/ksunaga-cq/received_events","type":"User","site_admin":false},"repo":{"id":134642412,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ2NDI0MTI=","name":"BookServer","full_name":"ksunaga-cq/BookServer","owner":{"login":"ksunaga-cq","id":36253986,"node_id":"MDQ6VXNlcjM2MjUzOTg2","avatar_url":"https://avatars0.githubusercontent.com/u/36253986?v=4","gravatar_id":"","url":"https://api.github.com/users/ksunaga-cq","html_url":"https://github.com/ksunaga-cq","followers_url":"https://api.github.com/users/ksunaga-cq/followers","following_url":"https://api.github.com/users/ksunaga-cq/following{/other_user}","gists_url":"https://api.github.com/users/ksunaga-cq/gists{/gist_id}","starred_url":"https://api.github.com/users/ksunaga-cq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksunaga-cq/subscriptions","organizations_url":"https://api.github.com/users/ksunaga-cq/orgs","repos_url":"https://api.github.com/users/ksunaga-cq/repos","events_url":"https://api.github.com/users/ksunaga-cq/events{/privacy}","received_events_url":"https://api.github.com/users/ksunaga-cq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ksunaga-cq/BookServer","description":null,"fork":false,"url":"https://api.github.com/repos/ksunaga-cq/BookServer","forks_url":"https://api.github.com/repos/ksunaga-cq/BookServer/forks","keys_url":"https://api.github.com/repos/ksunaga-cq/BookServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ksunaga-cq/BookServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ksunaga-cq/BookServer/teams","hooks_url":"https://api.github.com/repos/ksunaga-cq/BookServer/hooks","issue_events_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/events{/number}","events_url":"https://api.github.com/repos/ksunaga-cq/BookServer/events","assignees_url":"https://api.github.com/repos/ksunaga-cq/BookServer/assignees{/user}","branches_url":"https://api.github.com/repos/ksunaga-cq/BookServer/branches{/branch}","tags_url":"https://api.github.com/repos/ksunaga-cq/BookServer/tags","blobs_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ksunaga-cq/BookServer/statuses/{sha}","languages_url":"https://api.github.com/repos/ksunaga-cq/BookServer/languages","stargazers_url":"https://api.github.com/repos/ksunaga-cq/BookServer/stargazers","contributors_url":"https://api.github.com/repos/ksunaga-cq/BookServer/contributors","subscribers_url":"https://api.github.com/repos/ksunaga-cq/BookServer/subscribers","subscription_url":"https://api.github.com/repos/ksunaga-cq/BookServer/subscription","commits_url":"https://api.github.com/repos/ksunaga-cq/BookServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ksunaga-cq/BookServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ksunaga-cq/BookServer/contents/{+path}","compare_url":"https://api.github.com/repos/ksunaga-cq/BookServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ksunaga-cq/BookServer/merges","archive_url":"https://api.github.com/repos/ksunaga-cq/BookServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ksunaga-cq/BookServer/downloads","issues_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues{/number}","pulls_url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls{/number}","milestones_url":"https://api.github.com/repos/ksunaga-cq/BookServer/milestones{/number}","notifications_url":"https://api.github.com/repos/ksunaga-cq/BookServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ksunaga-cq/BookServer/labels{/name}","releases_url":"https://api.github.com/repos/ksunaga-cq/BookServer/releases{/id}","deployments_url":"https://api.github.com/repos/ksunaga-cq/BookServer/deployments","created_at":"2018-05-24T01:02:46Z","updated_at":"2018-05-24T01:28:20Z","pushed_at":"2018-06-05T03:22:33Z","git_url":"git://github.com/ksunaga-cq/BookServer.git","ssh_url":"git@github.com:ksunaga-cq/BookServer.git","clone_url":"https://github.com/ksunaga-cq/BookServer.git","svn_url":"https://github.com/ksunaga-cq/BookServer","homepage":null,"size":84,"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":"ksunaga-cq:master","ref":"master","sha":"73ac32b4148d61f33c718e4b3c65270134271b3b","user":{"login":"ksunaga-cq","id":36253986,"node_id":"MDQ6VXNlcjM2MjUzOTg2","avatar_url":"https://avatars0.githubusercontent.com/u/36253986?v=4","gravatar_id":"","url":"https://api.github.com/users/ksunaga-cq","html_url":"https://github.com/ksunaga-cq","followers_url":"https://api.github.com/users/ksunaga-cq/followers","following_url":"https://api.github.com/users/ksunaga-cq/following{/other_user}","gists_url":"https://api.github.com/users/ksunaga-cq/gists{/gist_id}","starred_url":"https://api.github.com/users/ksunaga-cq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksunaga-cq/subscriptions","organizations_url":"https://api.github.com/users/ksunaga-cq/orgs","repos_url":"https://api.github.com/users/ksunaga-cq/repos","events_url":"https://api.github.com/users/ksunaga-cq/events{/privacy}","received_events_url":"https://api.github.com/users/ksunaga-cq/received_events","type":"User","site_admin":false},"repo":{"id":134642412,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQ2NDI0MTI=","name":"BookServer","full_name":"ksunaga-cq/BookServer","owner":{"login":"ksunaga-cq","id":36253986,"node_id":"MDQ6VXNlcjM2MjUzOTg2","avatar_url":"https://avatars0.githubusercontent.com/u/36253986?v=4","gravatar_id":"","url":"https://api.github.com/users/ksunaga-cq","html_url":"https://github.com/ksunaga-cq","followers_url":"https://api.github.com/users/ksunaga-cq/followers","following_url":"https://api.github.com/users/ksunaga-cq/following{/other_user}","gists_url":"https://api.github.com/users/ksunaga-cq/gists{/gist_id}","starred_url":"https://api.github.com/users/ksunaga-cq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ksunaga-cq/subscriptions","organizations_url":"https://api.github.com/users/ksunaga-cq/orgs","repos_url":"https://api.github.com/users/ksunaga-cq/repos","events_url":"https://api.github.com/users/ksunaga-cq/events{/privacy}","received_events_url":"https://api.github.com/users/ksunaga-cq/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ksunaga-cq/BookServer","description":null,"fork":false,"url":"https://api.github.com/repos/ksunaga-cq/BookServer","forks_url":"https://api.github.com/repos/ksunaga-cq/BookServer/forks","keys_url":"https://api.github.com/repos/ksunaga-cq/BookServer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ksunaga-cq/BookServer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ksunaga-cq/BookServer/teams","hooks_url":"https://api.github.com/repos/ksunaga-cq/BookServer/hooks","issue_events_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/events{/number}","events_url":"https://api.github.com/repos/ksunaga-cq/BookServer/events","assignees_url":"https://api.github.com/repos/ksunaga-cq/BookServer/assignees{/user}","branches_url":"https://api.github.com/repos/ksunaga-cq/BookServer/branches{/branch}","tags_url":"https://api.github.com/repos/ksunaga-cq/BookServer/tags","blobs_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/refs{/sha}","trees_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ksunaga-cq/BookServer/statuses/{sha}","languages_url":"https://api.github.com/repos/ksunaga-cq/BookServer/languages","stargazers_url":"https://api.github.com/repos/ksunaga-cq/BookServer/stargazers","contributors_url":"https://api.github.com/repos/ksunaga-cq/BookServer/contributors","subscribers_url":"https://api.github.com/repos/ksunaga-cq/BookServer/subscribers","subscription_url":"https://api.github.com/repos/ksunaga-cq/BookServer/subscription","commits_url":"https://api.github.com/repos/ksunaga-cq/BookServer/commits{/sha}","git_commits_url":"https://api.github.com/repos/ksunaga-cq/BookServer/git/commits{/sha}","comments_url":"https://api.github.com/repos/ksunaga-cq/BookServer/comments{/number}","issue_comment_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/comments{/number}","contents_url":"https://api.github.com/repos/ksunaga-cq/BookServer/contents/{+path}","compare_url":"https://api.github.com/repos/ksunaga-cq/BookServer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ksunaga-cq/BookServer/merges","archive_url":"https://api.github.com/repos/ksunaga-cq/BookServer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ksunaga-cq/BookServer/downloads","issues_url":"https://api.github.com/repos/ksunaga-cq/BookServer/issues{/number}","pulls_url":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls{/number}","milestones_url":"https://api.github.com/repos/ksunaga-cq/BookServer/milestones{/number}","notifications_url":"https://api.github.com/repos/ksunaga-cq/BookServer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ksunaga-cq/BookServer/labels{/name}","releases_url":"https://api.github.com/repos/ksunaga-cq/BookServer/releases{/id}","deployments_url":"https://api.github.com/repos/ksunaga-cq/BookServer/deployments","created_at":"2018-05-24T01:02:46Z","updated_at":"2018-05-24T01:28:20Z","pushed_at":"2018-06-05T03:22:33Z","git_url":"git://github.com/ksunaga-cq/BookServer.git","ssh_url":"git@github.com:ksunaga-cq/BookServer.git","clone_url":"https://github.com/ksunaga-cq/BookServer.git","svn_url":"https://github.com/ksunaga-cq/BookServer","homepage":null,"size":84,"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/ksunaga-cq/BookServer/pulls/1"},"html":{"href":"https://github.com/ksunaga-cq/BookServer/pull/1"},"issue":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/1"},"comments":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/ksunaga-cq/BookServer/statuses/a6d34663f3e5afdee93071284319b45a9b5b09bb"}},"author_association":"OWNER"}}
{"actor":{"display_login":"khatamoto-cq"}}