如何在Ruby on Rails中使用Evernote gem创建注释?

时间:2011-06-16 00:39:14

标签: ruby-on-rails evernote

我在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)

我可以很好地访问用户的笔记。我的问题是,如何创建note object?

1 个答案:

答案 0 :(得分: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应用程序中,他们是如何构建笔记的。