summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.mkd4
-rw-r--r--VERSION1
-rw-r--r--evernote.gemspec2
-rw-r--r--example.rb27
-rw-r--r--lib/evernote/version.rb2
5 files changed, 31 insertions, 5 deletions
diff --git a/README.mkd b/README.mkd
index 4c72a78..0772cb9 100644
--- a/README.mkd
+++ b/README.mkd
@@ -5,6 +5,7 @@ This gem is a high level wrapper around Evernote's Thrift-generated ruby code. I
Get yourself a "Client application" API key from Evernote (http://www.evernote.com/about/developer/api/#key), which gives you a "consumer_key" and "consumer_secret" (note that a "web application" API key uses OAuth to authenticate and will not work). Put the key in a YML file or any other place you put configuration information. Also, get yourself a username and password on both their sandbox system (http://sandbox.evernote.com) and live system. You will be using sandbox for testing.
# usage #
+This script is also located in /example.rb
require 'evernote'
@@ -17,8 +18,6 @@ Get yourself a "Client application" API key from Evernote (http://www.evernote.c
:consumer_secret => 'YOUR_CONSUMER_SECRECT_FROM_EVERNOTE'
}
- # note, you could also read in your consumer key information from a YML file
-
user_store = Evernote::UserStore.new(user_store_url, config)
auth_result = user_store.authenticate
@@ -46,6 +45,7 @@ Thanks to the following peeps for helping out:
* Peter Mangiafico (peetucket)
* d1
+* Mikhail Zelenin (MioGreen)
## Copyright ##
diff --git a/VERSION b/VERSION
deleted file mode 100644
index ac39a10..0000000
--- a/VERSION
+++ /dev/null
@@ -1 +0,0 @@
-0.9.0
diff --git a/evernote.gemspec b/evernote.gemspec
index 45f98e3..20225b0 100644
--- a/evernote.gemspec
+++ b/evernote.gemspec
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
s.add_development_dependency "yard"
s.files = Dir.glob("{lib,spec,vendor}/**/*") +
- %w(LICENSE README.mkd Rakefile .gitignore)
+ %w(LICENSE README.mkd Rakefile .gitignore example.rb)
s.require_path = 'lib'
end
diff --git a/example.rb b/example.rb
new file mode 100644
index 0000000..861a412
--- /dev/null
+++ b/example.rb
@@ -0,0 +1,27 @@
+require 'rubygems'
+require 'evernote'
+
+user_store_url = "https://sandbox.evernote.com/edam/user"
+
+config = {
+ :username => 'username',
+ :password => 'password',
+ :consumer_key => 'consumer_key',
+ :consumer_secret => 'consumer_secret'
+}
+
+user_store = Evernote::UserStore.new(user_store_url, config)
+
+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}"
+
+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}"}
diff --git a/lib/evernote/version.rb b/lib/evernote/version.rb
index 0e8686b..855b01b 100644
--- a/lib/evernote/version.rb
+++ b/lib/evernote/version.rb
@@ -1,3 +1,3 @@
module Evernote
- VERSION = "1.0.0"
+ VERSION = "1.1.0"
end