{"action":"created","comment":{"url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/comments/28744224","id":28744224,"diff_hunk":"@@ -0,0 +1,34 @@\n+class WikiService\n+  include HTTParty\n+  attr_reader :base_uri, :default_params\n+\n+  def initialize\n+    @base_uri = \"http://en.wikipedia.org/w/api.php\"\n+    @default_params = { action: \"query\",\n+                        prop: \"revisions\",\n+                        format: \"json\",\n+                        rvprop: \"content\",\n+                      }\n+  end\n+\n+  def collect_data(titles)\n+    default_params[:titles] = titles\n+    summaries(responses).map { |summary| summary.split(\"\\n\").first.gsub(/[\\]}=\\/{|*+\\\\\\[<>]/, \"\")}.drop(1)\n+  end\n+\n+  private\n+\n+  def responses\n+     HTTParty.get(base_uri, query: default_params)\n+  end\n+\n+  def summaries(response)\n+    response[\"query\"][\"pages\"][page_id(response)][\"revisions\"].first[\"*\"].split(\"ShortSummary\")\n+  end\n+\n+  def page_id(response)\n+    response[\"query\"][\"pages\"].keys.first\n+  end\n+\n+end\n+","path":"app/services/wiki_service.rb","position":34,"original_position":34,"commit_id":"c872475842137fbe0052d89bee3b74bb10d9c656","original_commit_id":"c872475842137fbe0052d89bee3b74bb10d9c656","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"1 trailing blank lines detected.","created_at":"2015-04-21T01:35:43Z","updated_at":"2015-04-21T01:35:43Z","html_url":"https://github.com/skuhlmann/cheers-mail/pull/3#discussion_r28744224","pull_request_url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/comments/28744224"},"html":{"href":"https://github.com/skuhlmann/cheers-mail/pull/3#discussion_r28744224"},"pull_request":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3","id":33722169,"html_url":"https://github.com/skuhlmann/cheers-mail/pull/3","diff_url":"https://github.com/skuhlmann/cheers-mail/pull/3.diff","patch_url":"https://github.com/skuhlmann/cheers-mail/pull/3.patch","issue_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/3","number":3,"state":"open","locked":false,"title":"Api fetch","user":{"login":"skuhlmann","id":6923345,"avatar_url":"https://avatars.githubusercontent.com/u/6923345?v=3","gravatar_id":"","url":"https://api.github.com/users/skuhlmann","html_url":"https://github.com/skuhlmann","followers_url":"https://api.github.com/users/skuhlmann/followers","following_url":"https://api.github.com/users/skuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/skuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/skuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skuhlmann/subscriptions","organizations_url":"https://api.github.com/users/skuhlmann/orgs","repos_url":"https://api.github.com/users/skuhlmann/repos","events_url":"https://api.github.com/users/skuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/skuhlmann/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-21T01:35:38Z","updated_at":"2015-04-21T01:35:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"78b6c8a570354995fc507c19e6b5f5d0dc8e61b0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3/commits","review_comments_url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3/comments","review_comment_url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/comments{/number}","comments_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/3/comments","statuses_url":"https://api.github.com/repos/skuhlmann/cheers-mail/statuses/c872475842137fbe0052d89bee3b74bb10d9c656","head":{"label":"skuhlmann:api-fetch","ref":"api-fetch","sha":"c872475842137fbe0052d89bee3b74bb10d9c656","user":{"login":"skuhlmann","id":6923345,"avatar_url":"https://avatars.githubusercontent.com/u/6923345?v=3","gravatar_id":"","url":"https://api.github.com/users/skuhlmann","html_url":"https://github.com/skuhlmann","followers_url":"https://api.github.com/users/skuhlmann/followers","following_url":"https://api.github.com/users/skuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/skuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/skuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skuhlmann/subscriptions","organizations_url":"https://api.github.com/users/skuhlmann/orgs","repos_url":"https://api.github.com/users/skuhlmann/repos","events_url":"https://api.github.com/users/skuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/skuhlmann/received_events","type":"User","site_admin":false},"repo":{"id":28567522,"name":"cheers-mail","full_name":"skuhlmann/cheers-mail","owner":{"login":"skuhlmann","id":6923345,"avatar_url":"https://avatars.githubusercontent.com/u/6923345?v=3","gravatar_id":"","url":"https://api.github.com/users/skuhlmann","html_url":"https://github.com/skuhlmann","followers_url":"https://api.github.com/users/skuhlmann/followers","following_url":"https://api.github.com/users/skuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/skuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/skuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skuhlmann/subscriptions","organizations_url":"https://api.github.com/users/skuhlmann/orgs","repos_url":"https://api.github.com/users/skuhlmann/repos","events_url":"https://api.github.com/users/skuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/skuhlmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skuhlmann/cheers-mail","description":"","fork":false,"url":"https://api.github.com/repos/skuhlmann/cheers-mail","forks_url":"https://api.github.com/repos/skuhlmann/cheers-mail/forks","keys_url":"https://api.github.com/repos/skuhlmann/cheers-mail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skuhlmann/cheers-mail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skuhlmann/cheers-mail/teams","hooks_url":"https://api.github.com/repos/skuhlmann/cheers-mail/hooks","issue_events_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/events{/number}","events_url":"https://api.github.com/repos/skuhlmann/cheers-mail/events","assignees_url":"https://api.github.com/repos/skuhlmann/cheers-mail/assignees{/user}","branches_url":"https://api.github.com/repos/skuhlmann/cheers-mail/branches{/branch}","tags_url":"https://api.github.com/repos/skuhlmann/cheers-mail/tags","blobs_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/refs{/sha}","trees_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skuhlmann/cheers-mail/statuses/{sha}","languages_url":"https://api.github.com/repos/skuhlmann/cheers-mail/languages","stargazers_url":"https://api.github.com/repos/skuhlmann/cheers-mail/stargazers","contributors_url":"https://api.github.com/repos/skuhlmann/cheers-mail/contributors","subscribers_url":"https://api.github.com/repos/skuhlmann/cheers-mail/subscribers","subscription_url":"https://api.github.com/repos/skuhlmann/cheers-mail/subscription","commits_url":"https://api.github.com/repos/skuhlmann/cheers-mail/commits{/sha}","git_commits_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/commits{/sha}","comments_url":"https://api.github.com/repos/skuhlmann/cheers-mail/comments{/number}","issue_comment_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/comments{/number}","contents_url":"https://api.github.com/repos/skuhlmann/cheers-mail/contents/{+path}","compare_url":"https://api.github.com/repos/skuhlmann/cheers-mail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skuhlmann/cheers-mail/merges","archive_url":"https://api.github.com/repos/skuhlmann/cheers-mail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skuhlmann/cheers-mail/downloads","issues_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues{/number}","pulls_url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls{/number}","milestones_url":"https://api.github.com/repos/skuhlmann/cheers-mail/milestones{/number}","notifications_url":"https://api.github.com/repos/skuhlmann/cheers-mail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skuhlmann/cheers-mail/labels{/name}","releases_url":"https://api.github.com/repos/skuhlmann/cheers-mail/releases{/id}","created_at":"2014-12-28T17:36:26Z","updated_at":"2014-12-29T15:31:59Z","pushed_at":"2015-04-21T01:35:38Z","git_url":"git://github.com/skuhlmann/cheers-mail.git","ssh_url":"git@github.com:skuhlmann/cheers-mail.git","clone_url":"https://github.com/skuhlmann/cheers-mail.git","svn_url":"https://github.com/skuhlmann/cheers-mail","homepage":null,"size":240,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"skuhlmann:master","ref":"master","sha":"f416e33ab3ac814fcd37674bc7d2792a18b5ab83","user":{"login":"skuhlmann","id":6923345,"avatar_url":"https://avatars.githubusercontent.com/u/6923345?v=3","gravatar_id":"","url":"https://api.github.com/users/skuhlmann","html_url":"https://github.com/skuhlmann","followers_url":"https://api.github.com/users/skuhlmann/followers","following_url":"https://api.github.com/users/skuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/skuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/skuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skuhlmann/subscriptions","organizations_url":"https://api.github.com/users/skuhlmann/orgs","repos_url":"https://api.github.com/users/skuhlmann/repos","events_url":"https://api.github.com/users/skuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/skuhlmann/received_events","type":"User","site_admin":false},"repo":{"id":28567522,"name":"cheers-mail","full_name":"skuhlmann/cheers-mail","owner":{"login":"skuhlmann","id":6923345,"avatar_url":"https://avatars.githubusercontent.com/u/6923345?v=3","gravatar_id":"","url":"https://api.github.com/users/skuhlmann","html_url":"https://github.com/skuhlmann","followers_url":"https://api.github.com/users/skuhlmann/followers","following_url":"https://api.github.com/users/skuhlmann/following{/other_user}","gists_url":"https://api.github.com/users/skuhlmann/gists{/gist_id}","starred_url":"https://api.github.com/users/skuhlmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skuhlmann/subscriptions","organizations_url":"https://api.github.com/users/skuhlmann/orgs","repos_url":"https://api.github.com/users/skuhlmann/repos","events_url":"https://api.github.com/users/skuhlmann/events{/privacy}","received_events_url":"https://api.github.com/users/skuhlmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/skuhlmann/cheers-mail","description":"","fork":false,"url":"https://api.github.com/repos/skuhlmann/cheers-mail","forks_url":"https://api.github.com/repos/skuhlmann/cheers-mail/forks","keys_url":"https://api.github.com/repos/skuhlmann/cheers-mail/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skuhlmann/cheers-mail/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skuhlmann/cheers-mail/teams","hooks_url":"https://api.github.com/repos/skuhlmann/cheers-mail/hooks","issue_events_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/events{/number}","events_url":"https://api.github.com/repos/skuhlmann/cheers-mail/events","assignees_url":"https://api.github.com/repos/skuhlmann/cheers-mail/assignees{/user}","branches_url":"https://api.github.com/repos/skuhlmann/cheers-mail/branches{/branch}","tags_url":"https://api.github.com/repos/skuhlmann/cheers-mail/tags","blobs_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/refs{/sha}","trees_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skuhlmann/cheers-mail/statuses/{sha}","languages_url":"https://api.github.com/repos/skuhlmann/cheers-mail/languages","stargazers_url":"https://api.github.com/repos/skuhlmann/cheers-mail/stargazers","contributors_url":"https://api.github.com/repos/skuhlmann/cheers-mail/contributors","subscribers_url":"https://api.github.com/repos/skuhlmann/cheers-mail/subscribers","subscription_url":"https://api.github.com/repos/skuhlmann/cheers-mail/subscription","commits_url":"https://api.github.com/repos/skuhlmann/cheers-mail/commits{/sha}","git_commits_url":"https://api.github.com/repos/skuhlmann/cheers-mail/git/commits{/sha}","comments_url":"https://api.github.com/repos/skuhlmann/cheers-mail/comments{/number}","issue_comment_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/comments{/number}","contents_url":"https://api.github.com/repos/skuhlmann/cheers-mail/contents/{+path}","compare_url":"https://api.github.com/repos/skuhlmann/cheers-mail/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skuhlmann/cheers-mail/merges","archive_url":"https://api.github.com/repos/skuhlmann/cheers-mail/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skuhlmann/cheers-mail/downloads","issues_url":"https://api.github.com/repos/skuhlmann/cheers-mail/issues{/number}","pulls_url":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls{/number}","milestones_url":"https://api.github.com/repos/skuhlmann/cheers-mail/milestones{/number}","notifications_url":"https://api.github.com/repos/skuhlmann/cheers-mail/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skuhlmann/cheers-mail/labels{/name}","releases_url":"https://api.github.com/repos/skuhlmann/cheers-mail/releases{/id}","created_at":"2014-12-28T17:36:26Z","updated_at":"2014-12-29T15:31:59Z","pushed_at":"2015-04-21T01:35:38Z","git_url":"git://github.com/skuhlmann/cheers-mail.git","ssh_url":"git@github.com:skuhlmann/cheers-mail.git","clone_url":"https://github.com/skuhlmann/cheers-mail.git","svn_url":"https://github.com/skuhlmann/cheers-mail","homepage":null,"size":240,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3"},"html":{"href":"https://github.com/skuhlmann/cheers-mail/pull/3"},"issue":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/3"},"comments":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/skuhlmann/cheers-mail/statuses/c872475842137fbe0052d89bee3b74bb10d9c656"}}}}