{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/67715988","id":67715988,"diff_hunk":"@@ -0,0 +1,215 @@\n+from flask import request\n+import httplib as http\n+\n+from framework.auth.decorators import must_be_logged_in\n+from framework.exceptions import HTTPError, PermissionsError\n+\n+from website.addons.base import generic_views\n+from website.addons.evernote import utils\n+from website.addons.evernote.serializer import EvernoteSerializer\n+from website.oauth.models import ExternalAccount\n+from website.util import permissions\n+from website.project.decorators import (\n+    must_be_contributor_or_public,\n+    must_have_addon,\n+    must_be_addon_authorizer,\n+    must_not_be_registration,\n+    must_have_permission\n+)\n+\n+import ENML2HTML\n+\n+import logging\n+logger = logging.getLogger(__name__)\n+\n+SHORT_NAME = 'evernote'\n+FULL_NAME = 'Evernote'\n+\n+@must_be_logged_in\n+def evernote_get_user_settings(auth):\n+    \"\"\" Returns the list of all of the current user's authorized Evernote accounts \"\"\"\n+    serializer = EvernoteSerializer(user_settings=auth.user.get_addon('evernote'))\n+    return serializer.serialized_user_settings\n+\n+\n+@must_have_addon('evernote', 'node')\n+@must_have_permission(permissions.WRITE)\n+def evernote_get_config(node_addon, auth, **kwargs):","path":"website/addons/evernote/views.py","position":37,"original_position":37,"commit_id":"a68182267176952027013651dfc05556511568ae","original_commit_id":"a68182267176952027013651dfc05556511568ae","user":{"login":"mfraezz","id":5659262,"avatar_url":"https://avatars.githubusercontent.com/u/5659262?v=3","gravatar_id":"","url":"https://api.github.com/users/mfraezz","html_url":"https://github.com/mfraezz","followers_url":"https://api.github.com/users/mfraezz/followers","following_url":"https://api.github.com/users/mfraezz/following{/other_user}","gists_url":"https://api.github.com/users/mfraezz/gists{/gist_id}","starred_url":"https://api.github.com/users/mfraezz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mfraezz/subscriptions","organizations_url":"https://api.github.com/users/mfraezz/orgs","repos_url":"https://api.github.com/users/mfraezz/repos","events_url":"https://api.github.com/users/mfraezz/events{/privacy}","received_events_url":"https://api.github.com/users/mfraezz/received_events","type":"User","site_admin":false},"body":"This can be replaced with `generic_views.get_config`","created_at":"2016-06-20T16:00:54Z","updated_at":"2016-06-20T16:00:54Z","html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4670#discussion_r67715988","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments/67715988"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/4670#discussion_r67715988"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670","id":52280416,"html_url":"https://github.com/CenterForOpenScience/osf.io/pull/4670","diff_url":"https://github.com/CenterForOpenScience/osf.io/pull/4670.diff","patch_url":"https://github.com/CenterForOpenScience/osf.io/pull/4670.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4670","number":4670,"state":"open","locked":false,"title":"[WIP] Evernote addon:  skeleton with OAuth authorization and notebook selection","user":{"login":"rdhyee","id":153266,"avatar_url":"https://avatars.githubusercontent.com/u/153266?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhyee","html_url":"https://github.com/rdhyee","followers_url":"https://api.github.com/users/rdhyee/followers","following_url":"https://api.github.com/users/rdhyee/following{/other_user}","gists_url":"https://api.github.com/users/rdhyee/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhyee/subscriptions","organizations_url":"https://api.github.com/users/rdhyee/orgs","repos_url":"https://api.github.com/users/rdhyee/repos","events_url":"https://api.github.com/users/rdhyee/events{/privacy}","received_events_url":"https://api.github.com/users/rdhyee/received_events","type":"User","site_admin":false},"body":"Per suggestion from @lbanner and @samchrisinger, I'm issuing this pull request to begin process of eventually getting the first version of an Evernote addon merged into `develop`.  This is clearly a WIP.  \r\n\r\nThe basic approach I've taken is to build from the ground up an addon modeled mostly on the Box addon.  A few things to know:\r\n\r\n* Evernote uses OAuth 1.0a.  I had to make a small fix [outside of the Evernote addon directory](https://github.com/CenterForOpenScience/osf.io/compare/develop...rdhyee:evernote-oauth?expand=1#diff-6391da5157423e52547c9e0c599e76d9R168) to account for OAuth 1.0a.\r\n* Evernote has a production vs sandbox.\r\n* I mimicked Box in treating Evernote notebooks like Box folders. There are definite limits to this model:  notebooks contain notes but not other folders.  There are stacks, which can contain folders.  (I don't implement stacks yet.)\r\n* There is obviously extraneous stuff included to scaffold my learning process.  Also I'm sure there mistakes reflecting limited understanding of osf.io.  Please point them out.","created_at":"2015-12-01T16:28:10Z","updated_at":"2016-06-20T16:00:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1d3bd73aa211747df25737a04d3fdf211186715b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4670/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/a68182267176952027013651dfc05556511568ae","head":{"label":"rdhyee:evernote-oauth","ref":"evernote-oauth","sha":"a68182267176952027013651dfc05556511568ae","user":{"login":"rdhyee","id":153266,"avatar_url":"https://avatars.githubusercontent.com/u/153266?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhyee","html_url":"https://github.com/rdhyee","followers_url":"https://api.github.com/users/rdhyee/followers","following_url":"https://api.github.com/users/rdhyee/following{/other_user}","gists_url":"https://api.github.com/users/rdhyee/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhyee/subscriptions","organizations_url":"https://api.github.com/users/rdhyee/orgs","repos_url":"https://api.github.com/users/rdhyee/repos","events_url":"https://api.github.com/users/rdhyee/events{/privacy}","received_events_url":"https://api.github.com/users/rdhyee/received_events","type":"User","site_admin":false},"repo":{"id":41865707,"name":"osf.io","full_name":"rdhyee/osf.io","owner":{"login":"rdhyee","id":153266,"avatar_url":"https://avatars.githubusercontent.com/u/153266?v=3","gravatar_id":"","url":"https://api.github.com/users/rdhyee","html_url":"https://github.com/rdhyee","followers_url":"https://api.github.com/users/rdhyee/followers","following_url":"https://api.github.com/users/rdhyee/following{/other_user}","gists_url":"https://api.github.com/users/rdhyee/gists{/gist_id}","starred_url":"https://api.github.com/users/rdhyee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rdhyee/subscriptions","organizations_url":"https://api.github.com/users/rdhyee/orgs","repos_url":"https://api.github.com/users/rdhyee/repos","events_url":"https://api.github.com/users/rdhyee/events{/privacy}","received_events_url":"https://api.github.com/users/rdhyee/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rdhyee/osf.io","description":"Facilitating Open Science","fork":true,"url":"https://api.github.com/repos/rdhyee/osf.io","forks_url":"https://api.github.com/repos/rdhyee/osf.io/forks","keys_url":"https://api.github.com/repos/rdhyee/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rdhyee/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rdhyee/osf.io/teams","hooks_url":"https://api.github.com/repos/rdhyee/osf.io/hooks","issue_events_url":"https://api.github.com/repos/rdhyee/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/rdhyee/osf.io/events","assignees_url":"https://api.github.com/repos/rdhyee/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/rdhyee/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/rdhyee/osf.io/tags","blobs_url":"https://api.github.com/repos/rdhyee/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rdhyee/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rdhyee/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/rdhyee/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rdhyee/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/rdhyee/osf.io/languages","stargazers_url":"https://api.github.com/repos/rdhyee/osf.io/stargazers","contributors_url":"https://api.github.com/repos/rdhyee/osf.io/contributors","subscribers_url":"https://api.github.com/repos/rdhyee/osf.io/subscribers","subscription_url":"https://api.github.com/repos/rdhyee/osf.io/subscription","commits_url":"https://api.github.com/repos/rdhyee/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/rdhyee/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/rdhyee/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/rdhyee/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/rdhyee/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/rdhyee/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rdhyee/osf.io/merges","archive_url":"https://api.github.com/repos/rdhyee/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rdhyee/osf.io/downloads","issues_url":"https://api.github.com/repos/rdhyee/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/rdhyee/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/rdhyee/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/rdhyee/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rdhyee/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/rdhyee/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/rdhyee/osf.io/deployments","created_at":"2015-09-03T14:54:00Z","updated_at":"2016-01-11T16:07:16Z","pushed_at":"2016-05-19T00:25:13Z","git_url":"git://github.com/rdhyee/osf.io.git","ssh_url":"git@github.com:rdhyee/osf.io.git","clone_url":"https://github.com/rdhyee/osf.io.git","svn_url":"https://github.com/rdhyee/osf.io","homepage":"http://osf.io","size":130627,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"41f1b530101ea33c1af29d7e0bcea492822fa92b","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":10199599,"name":"osf.io","full_name":"CenterForOpenScience/osf.io","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/osf.io","description":"Facilitating Open Science","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/osf.io","forks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/releases{/id}","deployments_url":"https://api.github.com/repos/CenterForOpenScience/osf.io/deployments","created_at":"2013-05-21T15:53:37Z","updated_at":"2016-06-19T01:11:50Z","pushed_at":"2016-06-20T15:35:34Z","git_url":"git://github.com/CenterForOpenScience/osf.io.git","ssh_url":"git@github.com:CenterForOpenScience/osf.io.git","clone_url":"https://github.com/CenterForOpenScience/osf.io.git","svn_url":"https://github.com/CenterForOpenScience/osf.io","homepage":"http://osf.io","size":283543,"stargazers_count":225,"watchers_count":225,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":188,"mirror_url":null,"open_issues_count":217,"forks":188,"open_issues":217,"watchers":225,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670"},"html":{"href":"https://github.com/CenterForOpenScience/osf.io/pull/4670"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4670"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/issues/4670/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/pulls/4670/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/osf.io/statuses/a68182267176952027013651dfc05556511568ae"}}}}
{"actor":{"display_login":"mfraezz"}}