{"action":"created","comment":{"url":"https://api.github.com/repos/issyl0/departure-lounge/pulls/comments/68204604","id":68204604,"diff_hunk":"@@ -66,4 +66,15 @@ class DepartureLounge < Sinatra::Base\n   def pretty_time(string)\n     string.strftime(\"%H:%M\")\n   end\n+\n+  def extract_name_of_creator(event)\n+    event[\"creator\"][\"displayName\"] || extract_name_from_email(event)\n+  end\n+\n+  def extract_name_from_email(event)\n+    email = event[\"creator\"]['email']\n+    return nil if email.nil?\n+    user = (email.split(/@/).first || '')\n+    user.split('.').join(' ')","path":"app.rb","position":22,"original_position":22,"commit_id":"9cb5361b8503f25fbec687aae03b570259d2c58e","original_commit_id":"9cb5361b8503f25fbec687aae03b570259d2c58e","user":{"login":"issyl0","id":355033,"avatar_url":"https://avatars.githubusercontent.com/u/355033?v=3","gravatar_id":"","url":"https://api.github.com/users/issyl0","html_url":"https://github.com/issyl0","followers_url":"https://api.github.com/users/issyl0/followers","following_url":"https://api.github.com/users/issyl0/following{/other_user}","gists_url":"https://api.github.com/users/issyl0/gists{/gist_id}","starred_url":"https://api.github.com/users/issyl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issyl0/subscriptions","organizations_url":"https://api.github.com/users/issyl0/orgs","repos_url":"https://api.github.com/users/issyl0/repos","events_url":"https://api.github.com/users/issyl0/events{/privacy}","received_events_url":"https://api.github.com/users/issyl0/received_events","type":"User","site_admin":false},"body":"Does this Title Case the name?","created_at":"2016-06-23T09:39:54Z","updated_at":"2016-06-23T09:39:54Z","html_url":"https://github.com/issyl0/departure-lounge/pull/2#discussion_r68204604","pull_request_url":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/issyl0/departure-lounge/pulls/comments/68204604"},"html":{"href":"https://github.com/issyl0/departure-lounge/pull/2#discussion_r68204604"},"pull_request":{"href":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2","id":74921921,"html_url":"https://github.com/issyl0/departure-lounge/pull/2","diff_url":"https://github.com/issyl0/departure-lounge/pull/2.diff","patch_url":"https://github.com/issyl0/departure-lounge/pull/2.patch","issue_url":"https://api.github.com/repos/issyl0/departure-lounge/issues/2","number":2,"state":"open","locked":false,"title":"Extract name of creator from email too","user":{"login":"h-lame","id":608,"avatar_url":"https://avatars.githubusercontent.com/u/608?v=3","gravatar_id":"","url":"https://api.github.com/users/h-lame","html_url":"https://github.com/h-lame","followers_url":"https://api.github.com/users/h-lame/followers","following_url":"https://api.github.com/users/h-lame/following{/other_user}","gists_url":"https://api.github.com/users/h-lame/gists{/gist_id}","starred_url":"https://api.github.com/users/h-lame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-lame/subscriptions","organizations_url":"https://api.github.com/users/h-lame/orgs","repos_url":"https://api.github.com/users/h-lame/repos","events_url":"https://api.github.com/users/h-lame/events{/privacy}","received_events_url":"https://api.github.com/users/h-lame/received_events","type":"User","site_admin":false},"body":"We were seeing some `null`s as the name so we compare against `null` instead of `undefined`.  We also realised that if `creator.displayName` wasn't in the API response `creator.email` would be and we could pluck names from the user part of the email address.","created_at":"2016-06-23T09:25:18Z","updated_at":"2016-06-23T09:39:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2f0a780c234d0451cfc6118c21d1d2589fdfb374","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2/commits","review_comments_url":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2/comments","review_comment_url":"https://api.github.com/repos/issyl0/departure-lounge/pulls/comments{/number}","comments_url":"https://api.github.com/repos/issyl0/departure-lounge/issues/2/comments","statuses_url":"https://api.github.com/repos/issyl0/departure-lounge/statuses/9cb5361b8503f25fbec687aae03b570259d2c58e","head":{"label":"h-lame:extract-name-of-creator-from-email-too","ref":"extract-name-of-creator-from-email-too","sha":"9cb5361b8503f25fbec687aae03b570259d2c58e","user":{"login":"h-lame","id":608,"avatar_url":"https://avatars.githubusercontent.com/u/608?v=3","gravatar_id":"","url":"https://api.github.com/users/h-lame","html_url":"https://github.com/h-lame","followers_url":"https://api.github.com/users/h-lame/followers","following_url":"https://api.github.com/users/h-lame/following{/other_user}","gists_url":"https://api.github.com/users/h-lame/gists{/gist_id}","starred_url":"https://api.github.com/users/h-lame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-lame/subscriptions","organizations_url":"https://api.github.com/users/h-lame/orgs","repos_url":"https://api.github.com/users/h-lame/repos","events_url":"https://api.github.com/users/h-lame/events{/privacy}","received_events_url":"https://api.github.com/users/h-lame/received_events","type":"User","site_admin":false},"repo":{"id":61362266,"name":"departure-lounge","full_name":"h-lame/departure-lounge","owner":{"login":"h-lame","id":608,"avatar_url":"https://avatars.githubusercontent.com/u/608?v=3","gravatar_id":"","url":"https://api.github.com/users/h-lame","html_url":"https://github.com/h-lame","followers_url":"https://api.github.com/users/h-lame/followers","following_url":"https://api.github.com/users/h-lame/following{/other_user}","gists_url":"https://api.github.com/users/h-lame/gists{/gist_id}","starred_url":"https://api.github.com/users/h-lame/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h-lame/subscriptions","organizations_url":"https://api.github.com/users/h-lame/orgs","repos_url":"https://api.github.com/users/h-lame/repos","events_url":"https://api.github.com/users/h-lame/events{/privacy}","received_events_url":"https://api.github.com/users/h-lame/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/h-lame/departure-lounge","description":"Airport-style events dashboard using the Google Calendar API","fork":true,"url":"https://api.github.com/repos/h-lame/departure-lounge","forks_url":"https://api.github.com/repos/h-lame/departure-lounge/forks","keys_url":"https://api.github.com/repos/h-lame/departure-lounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/h-lame/departure-lounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/h-lame/departure-lounge/teams","hooks_url":"https://api.github.com/repos/h-lame/departure-lounge/hooks","issue_events_url":"https://api.github.com/repos/h-lame/departure-lounge/issues/events{/number}","events_url":"https://api.github.com/repos/h-lame/departure-lounge/events","assignees_url":"https://api.github.com/repos/h-lame/departure-lounge/assignees{/user}","branches_url":"https://api.github.com/repos/h-lame/departure-lounge/branches{/branch}","tags_url":"https://api.github.com/repos/h-lame/departure-lounge/tags","blobs_url":"https://api.github.com/repos/h-lame/departure-lounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/h-lame/departure-lounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/h-lame/departure-lounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/h-lame/departure-lounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/h-lame/departure-lounge/statuses/{sha}","languages_url":"https://api.github.com/repos/h-lame/departure-lounge/languages","stargazers_url":"https://api.github.com/repos/h-lame/departure-lounge/stargazers","contributors_url":"https://api.github.com/repos/h-lame/departure-lounge/contributors","subscribers_url":"https://api.github.com/repos/h-lame/departure-lounge/subscribers","subscription_url":"https://api.github.com/repos/h-lame/departure-lounge/subscription","commits_url":"https://api.github.com/repos/h-lame/departure-lounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/h-lame/departure-lounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/h-lame/departure-lounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/h-lame/departure-lounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/h-lame/departure-lounge/contents/{+path}","compare_url":"https://api.github.com/repos/h-lame/departure-lounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/h-lame/departure-lounge/merges","archive_url":"https://api.github.com/repos/h-lame/departure-lounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/h-lame/departure-lounge/downloads","issues_url":"https://api.github.com/repos/h-lame/departure-lounge/issues{/number}","pulls_url":"https://api.github.com/repos/h-lame/departure-lounge/pulls{/number}","milestones_url":"https://api.github.com/repos/h-lame/departure-lounge/milestones{/number}","notifications_url":"https://api.github.com/repos/h-lame/departure-lounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/h-lame/departure-lounge/labels{/name}","releases_url":"https://api.github.com/repos/h-lame/departure-lounge/releases{/id}","deployments_url":"https://api.github.com/repos/h-lame/departure-lounge/deployments","created_at":"2016-06-17T09:27:23Z","updated_at":"2016-06-17T09:27:23Z","pushed_at":"2016-06-23T09:23:47Z","git_url":"git://github.com/h-lame/departure-lounge.git","ssh_url":"git@github.com:h-lame/departure-lounge.git","clone_url":"https://github.com/h-lame/departure-lounge.git","svn_url":"https://github.com/h-lame/departure-lounge","homepage":"","size":244,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"issyl0:master","ref":"master","sha":"06f85559fc7eccc370363aa1e01d95c58cec8b19","user":{"login":"issyl0","id":355033,"avatar_url":"https://avatars.githubusercontent.com/u/355033?v=3","gravatar_id":"","url":"https://api.github.com/users/issyl0","html_url":"https://github.com/issyl0","followers_url":"https://api.github.com/users/issyl0/followers","following_url":"https://api.github.com/users/issyl0/following{/other_user}","gists_url":"https://api.github.com/users/issyl0/gists{/gist_id}","starred_url":"https://api.github.com/users/issyl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issyl0/subscriptions","organizations_url":"https://api.github.com/users/issyl0/orgs","repos_url":"https://api.github.com/users/issyl0/repos","events_url":"https://api.github.com/users/issyl0/events{/privacy}","received_events_url":"https://api.github.com/users/issyl0/received_events","type":"User","site_admin":false},"repo":{"id":37907648,"name":"departure-lounge","full_name":"issyl0/departure-lounge","owner":{"login":"issyl0","id":355033,"avatar_url":"https://avatars.githubusercontent.com/u/355033?v=3","gravatar_id":"","url":"https://api.github.com/users/issyl0","html_url":"https://github.com/issyl0","followers_url":"https://api.github.com/users/issyl0/followers","following_url":"https://api.github.com/users/issyl0/following{/other_user}","gists_url":"https://api.github.com/users/issyl0/gists{/gist_id}","starred_url":"https://api.github.com/users/issyl0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/issyl0/subscriptions","organizations_url":"https://api.github.com/users/issyl0/orgs","repos_url":"https://api.github.com/users/issyl0/repos","events_url":"https://api.github.com/users/issyl0/events{/privacy}","received_events_url":"https://api.github.com/users/issyl0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/issyl0/departure-lounge","description":"Airport-style events dashboard using the Google Calendar API","fork":true,"url":"https://api.github.com/repos/issyl0/departure-lounge","forks_url":"https://api.github.com/repos/issyl0/departure-lounge/forks","keys_url":"https://api.github.com/repos/issyl0/departure-lounge/keys{/key_id}","collaborators_url":"https://api.github.com/repos/issyl0/departure-lounge/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/issyl0/departure-lounge/teams","hooks_url":"https://api.github.com/repos/issyl0/departure-lounge/hooks","issue_events_url":"https://api.github.com/repos/issyl0/departure-lounge/issues/events{/number}","events_url":"https://api.github.com/repos/issyl0/departure-lounge/events","assignees_url":"https://api.github.com/repos/issyl0/departure-lounge/assignees{/user}","branches_url":"https://api.github.com/repos/issyl0/departure-lounge/branches{/branch}","tags_url":"https://api.github.com/repos/issyl0/departure-lounge/tags","blobs_url":"https://api.github.com/repos/issyl0/departure-lounge/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/issyl0/departure-lounge/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/issyl0/departure-lounge/git/refs{/sha}","trees_url":"https://api.github.com/repos/issyl0/departure-lounge/git/trees{/sha}","statuses_url":"https://api.github.com/repos/issyl0/departure-lounge/statuses/{sha}","languages_url":"https://api.github.com/repos/issyl0/departure-lounge/languages","stargazers_url":"https://api.github.com/repos/issyl0/departure-lounge/stargazers","contributors_url":"https://api.github.com/repos/issyl0/departure-lounge/contributors","subscribers_url":"https://api.github.com/repos/issyl0/departure-lounge/subscribers","subscription_url":"https://api.github.com/repos/issyl0/departure-lounge/subscription","commits_url":"https://api.github.com/repos/issyl0/departure-lounge/commits{/sha}","git_commits_url":"https://api.github.com/repos/issyl0/departure-lounge/git/commits{/sha}","comments_url":"https://api.github.com/repos/issyl0/departure-lounge/comments{/number}","issue_comment_url":"https://api.github.com/repos/issyl0/departure-lounge/issues/comments{/number}","contents_url":"https://api.github.com/repos/issyl0/departure-lounge/contents/{+path}","compare_url":"https://api.github.com/repos/issyl0/departure-lounge/compare/{base}...{head}","merges_url":"https://api.github.com/repos/issyl0/departure-lounge/merges","archive_url":"https://api.github.com/repos/issyl0/departure-lounge/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/issyl0/departure-lounge/downloads","issues_url":"https://api.github.com/repos/issyl0/departure-lounge/issues{/number}","pulls_url":"https://api.github.com/repos/issyl0/departure-lounge/pulls{/number}","milestones_url":"https://api.github.com/repos/issyl0/departure-lounge/milestones{/number}","notifications_url":"https://api.github.com/repos/issyl0/departure-lounge/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/issyl0/departure-lounge/labels{/name}","releases_url":"https://api.github.com/repos/issyl0/departure-lounge/releases{/id}","deployments_url":"https://api.github.com/repos/issyl0/departure-lounge/deployments","created_at":"2015-06-23T08:48:26Z","updated_at":"2016-04-22T12:39:07Z","pushed_at":"2016-06-23T09:25:18Z","git_url":"git://github.com/issyl0/departure-lounge.git","ssh_url":"git@github.com:issyl0/departure-lounge.git","clone_url":"https://github.com/issyl0/departure-lounge.git","svn_url":"https://github.com/issyl0/departure-lounge","homepage":"","size":242,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2"},"html":{"href":"https://github.com/issyl0/departure-lounge/pull/2"},"issue":{"href":"https://api.github.com/repos/issyl0/departure-lounge/issues/2"},"comments":{"href":"https://api.github.com/repos/issyl0/departure-lounge/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/issyl0/departure-lounge/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/issyl0/departure-lounge/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/issyl0/departure-lounge/statuses/9cb5361b8503f25fbec687aae03b570259d2c58e"}}}}
{"actor":{"display_login":"issyl0"}}