EvernoteUtils
A thin OOP-friendly wrapper of Evernote Ruby SDK.
Installation
Add this line to your application's Gemfile:
gem 'evernote_utils'
And then execute:
$ bundle
Or install it yourself as:
$ gem install evernote_utils
Requirement
If you don't have your Evernote API Key yet, get it from Evernote Developers Page.
Note that you should send "Activation Request" to access productionn data. Please check Frequently Ask Questions - Evernote Developers.
Then authenticate user's Evernote account via OAuth. Instruction is here: Getting Started with the Evernote API - Evernote Developers
EvenoteUtils don't support authentication feature, because dominant other options are available. For instance:
Usage
First, initialize ENUtils with an OAuth token credential identifier.
enutils = ENUtils::Core.new('oauth-token-credential-identifier')
# If you use sandbox token, pass 2nd argument false.
enutils = ENUtils::Core.new('oauth-token-credential-identifier', false)
OAuth token credential identifier looks something like:
S=s4:U=a1:E=12bfd68c6b6:C=12bf8426ab8:P=7:A=en_oauth_test:H=3df9cf6c0d7bc410824c80231e64dbe1
Then you can access Evernote resources.
enutils.notes(words: 'Clojure', limit: 5, order: :updated)
It returns ENUtils::Note instances. ENUtils::Note is a thin wrapper of Evernote::EDAM::Type::Tag.
And here, ENUtils#notes accepts following options:
- notebook
- tag, tags
- words (fulltext search api)
- order (
:created, :updated, :relevance, :update_sequence_number, :title) - asc (true/false)
- offset (default is 0)
- limit (default is 10)
ENUtils#notebooks and ENUtils#tags accept name filtering. You can use String or Regexp.
enutils.notebooks(name: 'Twitter')
enutils.(name: /ruby/i)
These methods return array of ENUtils::Notebook and ENUtils::Tag respectively, which available to filter notes.
notebook = enutils.notebooks(name: /Book/).first
tag = enutils.(name: 'language').first
enutils.notes(notebook: notebook, tag: tag)
# or, you can use multiple tags
enutils.notes(notebook: notebook, tags: [tagA, tagB, tagC])
Planning to do
- relationships: notebook.notes, note.tags, tag.notes
- counting result notes
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request