问题描述
我设法从我的Evernote生产帐户中获取自己的笔记。
但是,我不可能得到另一个帐户与我共享的笔记。
我不知道是不是因为这些方法已被弃用,但我根本不理解它。
任何帮助,示例代码或其他东西都会非常有用!!
提前致谢,
EHE
编辑:
我用来获取有人与我分享的笔记的代码如下:
def getEvernote():
authToken= "my_auth_token"
client = EvernoteClient(token=authToken, sandbox=False)
userStore = client.get_user_store()
user = userStore.getUser()
noteStore = client.get_note_store()
linked_notebooks = noteStore.listLinkedNotebooks(authToken)
shared_note_store = client.get_shared_note_store(linked_notebooks[0])
//Here, I manage to get the shared note store and the first shared notebook
updated_filter = NoteFilter(words=' ')
offset = 0
max_notes = 40000
result_spec = NotesMetadataResultSpec(includeTitle=True)
//What is shareKey???????
auth_result = shared_note_store.authenticateToSharedNotebook(shareKey, authToken)
//EDAM error
result_list = shared_note_store.findNotesMetadata(auth_result, updated_filter, offset, max_notes, result_spec)
任何帮助?
提前致谢
EHE
1楼
看看这里: : (查看“列出帐户中的所有共享笔记”部分)。
你有可以展示的代码吗?
这里有一些代码可以解决这个问题:
import evernote.edam.notestore.NoteStore as NoteStore
from evernote.api.client import EvernoteClient
from evernote.api.client import Store
from evernote.edam.notestore.ttypes import NoteFilter, NotesMetadataResultSpec
auth_token = "YOUR TOKEN"
client = EvernoteClient(token=auth_token, sandbox=True)
noteStore = client.get_note_store()
# get linked notebooks
linked_notebooks = noteStore.listLinkedNotebooks(auth_token)
linked_notebook = linked_notebooks[0]
# shareKey for the first notebook
shareKey = linked_notebook.shareKey
# get the right noteStore
note_store_uri = linked_notebook.noteStoreUrl
shared_note_store = Store(auth_token, NoteStore.Client, note_store_uri)
# authenticate to the linked notebook
auth_result = shared_note_store.authenticateToSharedNotebook(shareKey,auth_token)
# get the share token
share_token = auth_result.authenticationToken
updated_filter = NoteFilter(words=' ')
offset = 0
max_notes = 40000
result_spec = NotesMetadataResultSpec(includeTitle=True)
result_list = shared_note_store.findNotesMetadata(share_token, updated_filter, offset, max_notes, result_spec)
print result_list