summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.mkd21
-rw-r--r--lib/evernote/user_store.rb3
2 files changed, 5 insertions, 19 deletions
diff --git a/README.mkd b/README.mkd
index ba370b5..0c2bafc 100644
--- a/README.mkd
+++ b/README.mkd
@@ -2,27 +2,14 @@
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.
# usage #
-Create a config yml:
-
- 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:
+Get yourself an API key from Evernote, which gives you a "consumer_key" and "consumer_secret". Put those in a YML file or any other place you put configuration information. Also, get yourself a username and password (probably on their sandbox system).
+
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")
+ config={'username'=>'YOUR_USERNAME','password'=>'YOUR_PASSWORD','consumer_key'=>'YOUR_CONSUMER_KEY_FROM_EVERNOTE','consumer_secret'=>'YOUR_CONSUMER_SECRECT_FROM_EVERNOTE'}
+ user_store = Evernote::UserStore.new(user_store_url, config)
auth_result = user_store.authenticate
user = auth_result.user
diff --git a/lib/evernote/user_store.rb b/lib/evernote/user_store.rb
index b8b6102..44574fc 100644
--- a/lib/evernote/user_store.rb
+++ b/lib/evernote/user_store.rb
@@ -5,8 +5,7 @@ module Evernote
class UserStore
AuthenticationFailure = Class.new(StandardError)
- def initialize(uri, auth_file, auth_env, thrift_client_options = {})
- credentials = YAML.load_file(auth_file)[auth_env.to_s]
+ def initialize(uri, credentials, thrift_client_options = {})
@consumer_key = credentials["consumer_key"]
@consumer_secret = credentials["consumer_secret"]