简体   繁体   English

如何使用Evernote JavaScript SDK从Chrome扩展程序创建便笺?

[英]How to create a note from a chrome extension using the Evernote JavaScript SDK?

The documentation on http://dev.evernote.com/start/core/creating_notes.php states that as a prerequisite I should "[...] have a developer token (or a working OAuth implementation by which [I] retrieve a valid authentication token". I have both of that. Check. http://dev.evernote.com/start/core/creating_notes.php上的文档指出,作为先决条件,我应该“ [...]具有开发人员令牌(或有效的OAuth实施,通过该实施,[I]可以检索有效的身份验证令牌”。我同时拥有两者。请检查。

Next thing they assume is that "[I] have an instance of UserStore and NoteStore". 他们假设的下一件事是“ [I]具有UserStore和NoteStore的实例”。 This is where I'm struggling. 这就是我努力的地方。 I don't have that and I don't know how to get that. 我没有那个,我也不知道如何得到那个。

The code example on the page I linked above is in Python and Objective-C which is not really helpful in my case. 我上面链接的页面上的代码示例是使用Python和Objective-C编写的,对我而言并没有太大帮助。

I am using the Evernote JavaScript SDK ( https://github.com/evernote/evernote-sdk-js ), to be exact the evernote-sdk-minified.js , but I still can't figure out how to use the Evernote Cloud API ( http://dev.evernote.com/documentation/reference/ ) to create a note from my extension. 我正在使用Evernote JavaScript SDK( https://github.com/evernote/evernote-sdk-js ),确切地说是evernote-sdk-minified.js ,但我仍然不知道如何使用Evernote使用Cloud API( http://dev.evernote.com/documentation/reference/ )从扩展中创建便笺。

I tried something like 我尝试了类似的东西

var user = UserStore.getUser(auth_token);

but that doesn't seem to work 但这似乎不起作用

If anyone had the same problem and would post some sample code on how to get an instance of UserStore and NoteStore which, supposedly, I need to create a note and maybe even how to create the note itself, I would really appreciate it. 如果有人遇到相同的问题,并且会发布一些示例代码来说明如何获取UserStore和NoteStore的实例,据推测,我需要创建一个注释,甚至可能需要创建注释本身,我将非常感激。

Thanks! 谢谢!

Evernote doesn't allow client side Javascript access to its API due to cross-site scripting concerns. 由于跨站点脚本问题,Evernote不允许客户端Javascript访问其API。

To use the the Evernote Javascript SDK you will need to use PhoneGap like mentioned in another answer, node.js and the Evernote node module (available via npm ) or Apache Cordova . 要使用Evernote Javascript SDK,您将需要使用另一个答案中提到的PhoneGapnode.js和Evernote节点模块 (可通过npm获得 )或Apache Cordova

There is also a unofficial node module that can be used to access the Evernote API called Zookeeper . 还有一个非官方的节点模块,可用于访问名为Zookeeper的Evernote API。

The PhoneGap example has some sample code here . PhoneGap示例在此处包含一些示例代码。 You need to create a NoteStore client and call the createNote API. 您需要创建一个NoteStore客户端并调用createNote API。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 JAVASCRIPT SDK for EVERNOTE的问题 - Issue with JAVASCRIPT SDK for EVERNOTE 显示来自Chrome扩展程序的弹出窗口-如Evernote Web Clipper - Show popup from Chrome Extension - like Evernote Web Clipper 如何使用 JavaScript 创建一个 Chrome 扩展来隐藏或删除页面元素? - How to create a Chrome Extension to Hide or Remove a Page Element using JavaScript? 如何使用javascript在chrome扩展程序中创建会话? - How can I create session in my chrome extension using javascript? 使用Evernote的Javascript SDK生成listNotebooks请求时出错 - Error making listNotebooks request using Evernote's Javascript SDK 从扩展脚本使用 Facebook javascript SDK - Using Facebook javascript SDK from extension script 如何从 chrome 扩展程序创建隐身标签 - How to create incognito tab from chrome extension Facebook JavaScript SDK不适用于Chrome扩展程序 - The Facebook JavaScript SDK does not work on chrome extension 通过Thrift从Chrome扩展程序保存到Evernote的二进制文件在Unicode转换后出现乱码 - Binary file saved to Evernote from Chrome Extension via Thrift is garbled after Unicode conversion 如何在Express js中显示每个Evernote笔记的标题? - How to show the title of each Evernote note in Express js?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM