From e129dc5b3f70005e8b33a62f66e673a9c0d8084c Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Wed, 30 Dec 2015 18:41:49 -0800 Subject: Include 'kipcole9/evernote' note_store.rb directly Copy 'note_store.rb' from 'kipcole9/evernote' directly into my Evernote service file. I was getting a `LoadError` when trying to load the 'evernote' gem so to get moving quickly I'm just including the code directly in this app. We can figure out the issue with the gem later. Updating `NotesController` to interface with the 'evernote' gem classes and get notebooks using its API. --- app/controllers/notes_controller.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'app/controllers') diff --git a/app/controllers/notes_controller.rb b/app/controllers/notes_controller.rb index bf7f5ab..6b40ca3 100644 --- a/app/controllers/notes_controller.rb +++ b/app/controllers/notes_controller.rb @@ -5,9 +5,14 @@ class NotesController < ApplicationController auth_token = 'S=s1:U=91e2f:E=151f92661a2:C=151f4000220:P=185:A=evernotesandbox199:V=2:H=5777502290baf1ae1b36ad6254592258' notestore_url = 'https://sandbox.evernote.com/shard/s1/notestore' - e = EvernoteService.new(auth_token, notestore_url) - @notebooks = e.notebooks + # e = EvernoteService.new(auth_token, notestore_url) + # @notebooks = e.notebooks # @notes = @notebooks.collect { |b| e.notes_from_notebook(b) } + + access_token = auth_token + note_store = EvernoteService::NoteStore.new(notestore_url, access_token) + + @notebooks = note_store.list_notebooks end end -- cgit v1.2.3