0

我在我的 Ruby on Rails 应用程序中使用Evernote gem 。

我正在通过这样做创建一个 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)

我可以很好地访问用户的笔记。我的问题是,我如何创建一个笔记对象?

4

1 回答 1

2

尝试调用:

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)

在 evernote 官方 ruby​​ 应用程序中,这就是他们构建笔记的方式。

于 2011-06-16T00:52:22.883 回答