diff options
| author | Chris Sepic | 2010-03-19 08:03:56 -0500 | 
|---|---|---|
| committer | Chris Sepic | 2010-03-19 08:03:56 -0500 | 
| commit | fb215fe1509015a6100ef04781822c454f65fc29 (patch) | |
| tree | f7ae49421d77983ea133347c98f9b5b86459dca3 /README.mkd | |
| parent | d37a991568df31dd89521a09e1c9f25a5b9c4a94 (diff) | |
| download | evernote-fb215fe1509015a6100ef04781822c454f65fc29.tar.bz2 | |
added note store wrapper, added readme example
Diffstat (limited to 'README.mkd')
| -rw-r--r-- | README.mkd | 46 | 
1 files changed, 42 insertions, 4 deletions
| @@ -1,10 +1,48 @@  # evernote # -This gem is a high level wrapper around Evernote's Thrift-generated ruby code. It currently just bundles up Evernote's thrift-generated code. After installing, just require the gem in your project: +This gem is a high level wrapper around Evernote's Thrift-generated ruby code. It bundles up Evernote's thrift-generated code and creates some simple wrapper classes. -require 'evernote' +# usage # +Create a config yml: -# future releases # -This gem will eventually provide a cleaner API around the generated code, so you don't feel like you're writing Java. +    sandbox: +      username: user +      password: password +      consumer_key: key +      consumer_secret: secret +   +    production: +      username: user +      password: password +      consumer_key: key +      consumer_secret: secret + +Here's an example using the sandbox key: + +    require 'evernote' + +    user_store_url = "https://sandbox.evernote.com/edam/user" +    config = File.dirname(__FILE__) + "/config.yml" +    user_store = Evernote::UserStore.new(user_store_url, config, "sandbox") + +    auth_result = user_store.authenticate +    user = auth_result.user +    auth_token = auth_result.authenticationToken +    puts "Authentication was successful for #{user.username}" +    puts "Authentication token = #{auth_token}" + +Once you've authenticated, you could do something like list all of your notebooks: + +    note_store_url = "http://sandbox.evernote.com/edam/note/#{user.shardId}" +    note_store = Evernote::NoteStore.new(note_store_url) + +    notebooks = note_store.listNotebooks(auth_token) +    puts "Found #{notebooks.size} notebooks:" +    default_notebook = notebooks[0] +    notebooks.each { |notebook| puts "  * #{notebook.name}"} + +The evernote API can be viewed at http://www.evernote.com/about/developer/api/ref/ + +If the vendored code is out of date and you get an error indicating so, feel free to create an issue at http://github.com/cgs/evernote/issues  ## Copyright ##  Copyright (c) 2010 Chris Sepic. See LICENSE for details. | 
