ProductPromotion
Logo

Elixir

made by https://0x3d.site

GitHub - jwarlander/everex: Evernote API client for Elixir
Evernote API client for Elixir. Contribute to jwarlander/everex development by creating an account on GitHub.
Visit Site

GitHub - jwarlander/everex: Evernote API client for Elixir

GitHub - jwarlander/everex: Evernote API client for Elixir

Build Status

Everex is an Evernote API client for Elixir. It uses a modified version of the Erlang Thrift library, together with compiled output from the Evernote Cloud API IDL files.

NOTE: Everex is UNDER DEVELOPMENT, and is NOT ready for production use. Feedback and contributions (via pull requests) are very welcome, of course!

Status

It's so far possible to list tags, list notebooks, find notes, and retrieve note data.

An authentication token is required before connecting, and can be either a user token retrieved using OAuth or a developer token.

Everex now represents Thrift data structures as structs, to keep client usage idiomatic and the data more self-explanatory. See examples below.

UPDATE: There is now an example showing how to get access using the OAuth authentication process. See examples/oauth.exs. This requires having an API key, of course, and exporting the environment variables EN_CONSUMER_KEY / EN_CONSUMER_SECRET before running the example.

Usage

Add Everex to your dependencies in mix.exs:

  defp deps do
    [{:everex, "~> 0.1.1"}]
  end

You also need to include :everex in your application list:

  def application do
    [applications: [:everex]]
  end

Examples

NOTE: It's assumed that you're testing in the Evernote Sandbox, with a developer token.

iex(1)> {:ok, client} = Everex.Client.new(System.get_env("EN_DEVELOPER_TOKEN"), sandbox: true)
{:ok, #PID<0.1295.0>}
iex(2)> client |> Everex.NoteStore.list_tags
{:ok,
 [%Everex.Types.Tag{guid: "98590060-4eaa-44fe-8514-50cb158742c2",
   name: "one_tag", parentGuid: :undefined, updateSequenceNum: 20},
  %Everex.Types.Tag{guid: "f8484cd9-f213-4072-9df5-c0ab49f79fe3",
   name: "another_tag", parentGuid: :undefined, updateSequenceNum: 22}]}
iex(3)> tag_filter = %Everex.Types.NoteFilter{tagGuids: ["98590060-4eaa-44fe-8514-50cb158742c2"]}
%Everex.Types.NoteFilter{ascending: :undefined, emphasized: :undefined,
 inactive: :undefined, notebookGuid: :undefined, order: :undefined,
 tagGuids: ["98590060-4eaa-44fe-8514-50cb158742c2"], timeZone: :undefined,
 words: :undefined}
iex(4)> client |> Everex.NoteStore.find_notes_metadata(tag_filter)
{:ok,
 %Everex.Types.NotesMetadataList{notes: [%Everex.Types.NoteMetadata{attributes: :undefined,
    contentLength: :undefined, created: :undefined, deleted: :undefined,
    guid: "9a6cbc15-613c-4e77-b184-76829421c3db",
    largestResourceMime: :undefined, largestResourceSize: :undefined,
    notebookGuid: :undefined, tagGuids: :undefined, title: :undefined,
    updateSequenceNum: :undefined, updated: :undefined}],
  searchedWords: :undefined, startIndex: 0, stoppedWords: :undefined,
  totalNotes: 1, updateCount: 22}}
iex(5)> client |> Everex.NoteStore.get_note("9a6cbc15-613c-4e77-b184-76829421c3db",true)
{:ok,
 %Everex.Types.Note{active: true,
  attributes: %Everex.Types.NoteAttributes{altitude: :undefined,
   applicationData: :undefined, author: "jevernotedev",
   classifications: :undefined, contentClass: :undefined, creatorId: :undefined,
   lastEditedBy: :undefined, lastEditorId: :undefined, latitude: :undefined,
   longitude: :undefined, placeName: :undefined, reminderDoneTime: :undefined,
   reminderOrder: :undefined, reminderTime: :undefined, shareDate: :undefined,
   source: :undefined, sourceApplication: :undefined, sourceURL: :undefined,
   subjectDate: :undefined},
  content: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE en-note SYSTEM \"http://xml.evernote.com/pub/enml2.dtd\">\n<en-note><div>We'll tag these, too!<br clear=\"none\"/></div><div><br clear=\"none\"/></div></en-note>",
  contentHash: <<224, 142, 222, 77, 133, 184, 83, 71, 40, 126, 14, 48, 128, 249, 99, 18>>,
  contentLength: 203, created: 1424066828000, deleted: :undefined,
  guid: "9a6cbc15-613c-4e77-b184-76829421c3db",
  notebookGuid: "ebaf248b-667b-4511-beb5-ab3e8749d38d", resources: :undefined,
  tagGuids: ["98590060-4eaa-44fe-8514-50cb158742c2"], tagNames: :undefined,
  title: "Another test, to be sure", updateSequenceNum: 19,
  updated: 1424066857000}}

Testing

For testing, you'll need an Evernote Sandbox account and a personal developer token:

export EN_DEVELOPER_TOKEN="<your_token>"
mix test

License

Copyright 2015 Johan Wärlander

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Articles
to learn more about the elixir concepts.

Resources
which are currently available to browse on.

mail [email protected] to add your project or resources here 🔥.

FAQ's
to know more about the topic.

mail [email protected] to add your project or resources here 🔥.

Queries
or most google FAQ's about Elixir.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory