{"action":"created","comment":{"url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/comments/53029117","id":53029117,"diff_hunk":"@@ -7,61 +10,8 @@ def initialize(outputs)\n     end\n \n     def process(events)\n-      return if events.empty?\n-\n-      known_events = events.select do |event|\n-        type = event_type(event)\n-        known_event?(event_model(type))\n-      end\n-\n-      known_events = known_events.map do |event|\n-        strip_private_fields(geolocate(event))\n-      end\n-\n-      outputs.each { |output| output.write(known_events) }\n-    end\n-\n-    private\n-\n-    def known_events\n-      @known_events ||= %w(classification workflow_counters comment)\n-    end\n-\n-    def known_event?(event_model)\n-      known_events.include?(event_model)\n-    end\n-\n-    def event_model(type)\n-      type.split(\".\").last if type\n-    end\n-\n-    def event_type(event)\n-      event.fetch(\"event_type\", nil)\n-    end\n-\n-    def geolocate(event)\n-      return event unless event[\"_ip_address\"]\n-\n-      result = Geocoder.search(event[\"_ip_address\"])\n-\n-      if match = result[0]\n-        event.merge(geo: {\n-          country_name: match.country,\n-          country_code: match.country_code,\n-          city_name: match.city,\n-          coordinates: [match.longitude, match.latitude],\n-          latitude: match.latitude,\n-          longitude: match.longitude\n-        })\n-      else\n-        event\n-      end\n-    rescue StandardError\n-      event\n-    end\n-\n-    def strip_private_fields(event)","path":"lib/processor.rb","position":64,"original_position":64,"commit_id":"7e685a21743ee403a55c3d0c66739119b498091a","original_commit_id":"7e685a21743ee403a55c3d0c66739119b498091a","user":{"login":"camallen","id":295329,"avatar_url":"https://avatars.githubusercontent.com/u/295329?v=3","gravatar_id":"","url":"https://api.github.com/users/camallen","html_url":"https://github.com/camallen","followers_url":"https://api.github.com/users/camallen/followers","following_url":"https://api.github.com/users/camallen/following{/other_user}","gists_url":"https://api.github.com/users/camallen/gists{/gist_id}","starred_url":"https://api.github.com/users/camallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/camallen/subscriptions","organizations_url":"https://api.github.com/users/camallen/orgs","repos_url":"https://api.github.com/users/camallen/repos","events_url":"https://api.github.com/users/camallen/events{/privacy}","received_events_url":"https://api.github.com/users/camallen/received_events","type":"User","site_admin":false},"body":"I can't see where we're stripping the IP in the output messages?","created_at":"2016-02-16T15:50:57Z","updated_at":"2016-02-16T15:50:57Z","html_url":"https://github.com/zooniverse/zoo-event-stats/pull/29#discussion_r53029117","pull_request_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29","_links":{"self":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/comments/53029117"},"html":{"href":"https://github.com/zooniverse/zoo-event-stats/pull/29#discussion_r53029117"},"pull_request":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29","id":59507475,"html_url":"https://github.com/zooniverse/zoo-event-stats/pull/29","diff_url":"https://github.com/zooniverse/zoo-event-stats/pull/29.diff","patch_url":"https://github.com/zooniverse/zoo-event-stats/pull/29.patch","issue_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/29","number":29,"state":"open","locked":false,"title":"Convert stats to read from Kinesis","user":{"login":"marten","id":277,"avatar_url":"https://avatars.githubusercontent.com/u/277?v=3","gravatar_id":"","url":"https://api.github.com/users/marten","html_url":"https://github.com/marten","followers_url":"https://api.github.com/users/marten/followers","following_url":"https://api.github.com/users/marten/following{/other_user}","gists_url":"https://api.github.com/users/marten/gists{/gist_id}","starred_url":"https://api.github.com/users/marten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marten/subscriptions","organizations_url":"https://api.github.com/users/marten/orgs","repos_url":"https://api.github.com/users/marten/repos","events_url":"https://api.github.com/users/marten/events{/privacy}","received_events_url":"https://api.github.com/users/marten/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-16T15:35:00Z","updated_at":"2016-02-16T15:50:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e6e2f3508eb4f1a5e76de2b0ced604a24b02fbf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29/commits","review_comments_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29/comments","review_comment_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/29/comments","statuses_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/statuses/7e685a21743ee403a55c3d0c66739119b498091a","head":{"label":"zooniverse:kinesis","ref":"kinesis","sha":"7e685a21743ee403a55c3d0c66739119b498091a","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":46431297,"name":"zoo-event-stats","full_name":"zooniverse/zoo-event-stats","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/zoo-event-stats","description":"Event stream and stats for the Zooniverse","fork":false,"url":"https://api.github.com/repos/zooniverse/zoo-event-stats","forks_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/forks","keys_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/teams","hooks_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/events","assignees_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/tags","blobs_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/languages","stargazers_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/subscription","commits_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/merges","archive_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/downloads","issues_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/releases{/id}","deployments_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/deployments","created_at":"2015-11-18T16:21:09Z","updated_at":"2016-01-14T21:07:10Z","pushed_at":"2016-02-16T15:35:00Z","git_url":"git://github.com/zooniverse/zoo-event-stats.git","ssh_url":"git@github.com:zooniverse/zoo-event-stats.git","clone_url":"https://github.com/zooniverse/zoo-event-stats.git","svn_url":"https://github.com/zooniverse/zoo-event-stats","homepage":null,"size":20094,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"base":{"label":"zooniverse:master","ref":"master","sha":"9fe96c8af0f05029a6a83a2b4befe884b0e82f8c","user":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"repo":{"id":46431297,"name":"zoo-event-stats","full_name":"zooniverse/zoo-event-stats","owner":{"login":"zooniverse","id":106856,"avatar_url":"https://avatars.githubusercontent.com/u/106856?v=3","gravatar_id":"","url":"https://api.github.com/users/zooniverse","html_url":"https://github.com/zooniverse","followers_url":"https://api.github.com/users/zooniverse/followers","following_url":"https://api.github.com/users/zooniverse/following{/other_user}","gists_url":"https://api.github.com/users/zooniverse/gists{/gist_id}","starred_url":"https://api.github.com/users/zooniverse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zooniverse/subscriptions","organizations_url":"https://api.github.com/users/zooniverse/orgs","repos_url":"https://api.github.com/users/zooniverse/repos","events_url":"https://api.github.com/users/zooniverse/events{/privacy}","received_events_url":"https://api.github.com/users/zooniverse/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/zooniverse/zoo-event-stats","description":"Event stream and stats for the Zooniverse","fork":false,"url":"https://api.github.com/repos/zooniverse/zoo-event-stats","forks_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/forks","keys_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/teams","hooks_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/hooks","issue_events_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/events{/number}","events_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/events","assignees_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/assignees{/user}","branches_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/branches{/branch}","tags_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/tags","blobs_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/refs{/sha}","trees_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/statuses/{sha}","languages_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/languages","stargazers_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/stargazers","contributors_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/contributors","subscribers_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/subscribers","subscription_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/subscription","commits_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/commits{/sha}","git_commits_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/git/commits{/sha}","comments_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/comments{/number}","issue_comment_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/comments{/number}","contents_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/contents/{+path}","compare_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/merges","archive_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/downloads","issues_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues{/number}","pulls_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls{/number}","milestones_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/milestones{/number}","notifications_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/labels{/name}","releases_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/releases{/id}","deployments_url":"https://api.github.com/repos/zooniverse/zoo-event-stats/deployments","created_at":"2015-11-18T16:21:09Z","updated_at":"2016-01-14T21:07:10Z","pushed_at":"2016-02-16T15:35:00Z","git_url":"git://github.com/zooniverse/zoo-event-stats.git","ssh_url":"git@github.com:zooniverse/zoo-event-stats.git","clone_url":"https://github.com/zooniverse/zoo-event-stats.git","svn_url":"https://github.com/zooniverse/zoo-event-stats","homepage":null,"size":20094,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29"},"html":{"href":"https://github.com/zooniverse/zoo-event-stats/pull/29"},"issue":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/29"},"comments":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/zooniverse/zoo-event-stats/statuses/7e685a21743ee403a55c3d0c66739119b498091a"}}}}