[英]How do I create a note using the Evernote gem in Ruby on Rails?
I am using the Evernote gem in my Ruby on Rails app. 我在Ruby on Rails应用程序中使用Evernote gem 。
I am creating a NoteStore by doing this: 我通过这样做创建一个NoteStore:
# Construct the URL used to access the user's account
noteStoreUrl = "https://sandbox.evernote.com/edam/note/" + shard_id
noteStoreTransport = Thrift::HTTPClientTransport.new(noteStoreUrl)
noteStoreProtocol = Thrift::BinaryProtocol.new(noteStoreTransport)
noteStore = Evernote::EDAM::NoteStore::NoteStore::Client.new(noteStoreProtocol)
I can access the users' notes fine. 我可以很好地访问用户的笔记。 My question is, how do I create a note object?
我的问题是,如何创建注释对象?
Try calling: 试着打电话:
note = Evernote::EDAM::Type::Note.new()
note.title = "Test note from ENTest.rb"
note.content = '<?xml version="1.0" encoding="UTF-8"?>' +
'<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">' +
'<en-note>Here is the Evernote logo:<br/>'
createdNote = noteStore.createNote(authToken, note)
In the evernote official ruby app that's how they construct the note. 在evernote官方ruby应用程序中,他们是如何构建笔记的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.