{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/84560756","pull_request_review_id":5335051,"id":84560756,"diff_hunk":"@@ -0,0 +1,19 @@\n+/**\n+ * External dependencies\n+ */\n+import has from 'lodash/has';","path":"client/state/current-user/gravatar-status/selectors.js","position":4,"original_position":4,"commit_id":"fb31ab4183dfaafe6d54d090d4a5467f4f5d45dd","original_commit_id":"fb31ab4183dfaafe6d54d090d4a5467f4f5d45dd","user":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"body":"Optional, but we now use `babel-plugin-lodash` that transforms this for us. So we can stick with:\r\n```\r\nimport { has } from `lodash`;\r\n```","created_at":"2016-10-21T23:29:23Z","updated_at":"2016-10-21T23:29:23Z","html_url":"https://github.com/Automattic/wp-calypso/pull/8456#discussion_r84560756","pull_request_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456","_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments/84560756"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/8456#discussion_r84560756"},"pull_request":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456","id":87955062,"html_url":"https://github.com/Automattic/wp-calypso/pull/8456","diff_url":"https://github.com/Automattic/wp-calypso/pull/8456.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/8456.patch","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8456","number":8456,"state":"open","locked":false,"title":"Upload a new Gravatar directly from Calypso","user":{"login":"v18","id":11487924,"avatar_url":"https://avatars.githubusercontent.com/u/11487924?v=3","gravatar_id":"","url":"https://api.github.com/users/v18","html_url":"https://github.com/v18","followers_url":"https://api.github.com/users/v18/followers","following_url":"https://api.github.com/users/v18/following{/other_user}","gists_url":"https://api.github.com/users/v18/gists{/gist_id}","starred_url":"https://api.github.com/users/v18/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/v18/subscriptions","organizations_url":"https://api.github.com/users/v18/orgs","repos_url":"https://api.github.com/users/v18/repos","events_url":"https://api.github.com/users/v18/events{/privacy}","received_events_url":"https://api.github.com/users/v18/received_events","type":"User","site_admin":false},"body":"This is an in-progress PR for letting users upload a new Gravatar directly from Calypso, solving #7238.\r\n\r\nCurrently, these are the changes:\r\n\r\n1. You can select an image from your computer in `/me`\r\n2. Once an image is selected, it's automatically uploaded to Gravatar.com and set as your new Gravatar\r\n3. The results are logged in the console\r\n\r\n![pr-gif](https://cloud.githubusercontent.com/assets/11487924/19088357/72a8b246-8a7e-11e6-9090-a324defba5ba.gif)\r\n\r\n\r\nTesting is a bit complicated for now :)\r\n\r\n**Steps to test on Chrome:**\r\n\r\n1. Get a bearer token - you can use [this script](https://gist.github.com/hypest/105aeef7bf863675956c) by @hypest:\r\n\r\n    ```\r\n    curl -# -X POST --data-urlencode \"grant_type=password\" --data-urlencode \"client_id=appid\" --data-urlencode \"client_secret=appsecret\" --data-urlencode \"username=username\" --data-urlencode \"password=password\" https://public-api.wordpress.com/oauth2/token\r\n    ```\r\n    You can use Calypso's app ID & secret, found [here](https://github.com/Automattic/wp-calypso/blob/a1c610c300e040a2c101bb5af6a66f7cd72b52d6/config/production.json#L108-L109).\r\nIf you have 2FA enabled, you can add this extra parameter to the call: `--data-urlencode \"wpcom_otp=one-time-password\"`, or you can create a new application password to use instead.\r\n2. Save the bearer token to localStorage using `localStorage.setItem('bearerToken', 'your_bearer_token')`.\r\n3. Go to `calypso.localhost:3000/me` and click on 'Select Image' to upload a new Gravatar\r\n\r\n**Steps to test on Chrome, with oauth enabled:**\r\n\r\n1. In `config/development.json`, change `features/oauth` to `true`\r\n2. In `config/_shared.json` set `oauth_client_id` to Calypso's client ID.\r\n3. Go to `calypso.localhost:3000/me` and click on 'Select Image' to upload a new Gravatar\r\n\r\n**Steps to test on the Desktop app:**\r\n\r\nThe desktop app does use a bearer token for making wpcom requests, so it's a bit easier to test.\r\n\r\n1. Install the desktop app [as explained here](https://github.com/Automattic/wp-desktop)\r\n2. Inside the `wp-desktop/calypso` directory, make sure to checkout the `add/gravatar-uploading` branch\r\n3. In the file `desktop-config/config-base.json`, add `\"webSecurity\": false` under `webPreferences`\r\n4. Run the desktop app\r\n5. One the app is running, go to `/me`and and click on 'Select Image' to upload a new Gravatar","created_at":"2016-10-04T19:09:48Z","updated_at":"2016-10-21T23:29:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"04f23499066a2c6bef931135aa6b2951fada3e52","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456/commits","review_comments_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456/comments","review_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/8456/comments","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/fb31ab4183dfaafe6d54d090d4a5467f4f5d45dd","head":{"label":"Automattic:add/gravatar-uploading","ref":"add/gravatar-uploading","sha":"fb31ab4183dfaafe6d54d090d4a5467f4f5d45dd","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-10-21T23:01:04Z","pushed_at":"2016-10-21T22:50:37Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":145693,"stargazers_count":7932,"watchers_count":7932,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":996,"mirror_url":null,"open_issues_count":1480,"forks":996,"open_issues":1480,"watchers":7932,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"cca2054e2d5f82a93b510e0c3837fc17c1905a21","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":45936895,"name":"wp-calypso","full_name":"Automattic/wp-calypso","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/wp-calypso","description":"The new JavaScript- and API-powered WordPress.com","fork":false,"url":"https://api.github.com/repos/Automattic/wp-calypso","forks_url":"https://api.github.com/repos/Automattic/wp-calypso/forks","keys_url":"https://api.github.com/repos/Automattic/wp-calypso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/wp-calypso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/wp-calypso/teams","hooks_url":"https://api.github.com/repos/Automattic/wp-calypso/hooks","issue_events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/wp-calypso/events","assignees_url":"https://api.github.com/repos/Automattic/wp-calypso/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/wp-calypso/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/wp-calypso/tags","blobs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/wp-calypso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/wp-calypso/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/wp-calypso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/wp-calypso/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/wp-calypso/languages","stargazers_url":"https://api.github.com/repos/Automattic/wp-calypso/stargazers","contributors_url":"https://api.github.com/repos/Automattic/wp-calypso/contributors","subscribers_url":"https://api.github.com/repos/Automattic/wp-calypso/subscribers","subscription_url":"https://api.github.com/repos/Automattic/wp-calypso/subscription","commits_url":"https://api.github.com/repos/Automattic/wp-calypso/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/wp-calypso/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/wp-calypso/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/wp-calypso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/wp-calypso/merges","archive_url":"https://api.github.com/repos/Automattic/wp-calypso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/wp-calypso/downloads","issues_url":"https://api.github.com/repos/Automattic/wp-calypso/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/wp-calypso/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/wp-calypso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/wp-calypso/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/wp-calypso/deployments","created_at":"2015-11-10T20:00:16Z","updated_at":"2016-10-21T23:01:04Z","pushed_at":"2016-10-21T22:50:37Z","git_url":"git://github.com/Automattic/wp-calypso.git","ssh_url":"git@github.com:Automattic/wp-calypso.git","clone_url":"https://github.com/Automattic/wp-calypso.git","svn_url":"https://github.com/Automattic/wp-calypso","homepage":"https://developer.wordpress.com/calypso/","size":145693,"stargazers_count":7932,"watchers_count":7932,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":996,"mirror_url":null,"open_issues_count":1480,"forks":996,"open_issues":1480,"watchers":7932,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456"},"html":{"href":"https://github.com/Automattic/wp-calypso/pull/8456"},"issue":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/8456"},"comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/issues/8456/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/wp-calypso/pulls/8456/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/wp-calypso/statuses/fb31ab4183dfaafe6d54d090d4a5467f4f5d45dd"}}}}
{"actor":{"display_login":"gwwar"}}