Permalink
Browse files

CreatNote example case

  • Loading branch information...
1 parent dc5b42c commit c99b1be331df54b81cc8d41c608ea56bae53bef6 @wanasit committed Mar 8, 2013
Showing with 36 additions and 4 deletions.
  1. +0 −3 everest.js
  2. +0 −1 evernode/index.js
  3. +36 −0 examples/CreateNote.js
View
@@ -422,9 +422,6 @@ app.all('/notebooks/:guid/expunge', function(req, res){
});
});
-
-
-
//===================================================
// Sync
//===================================================
View
@@ -6,4 +6,3 @@ exports.UserStore = require('./lib/evernote-thrift/gen-nodejs/UserStore')
exports.NoteStore = require('./lib/evernote-thrift/gen-nodejs/NoteStore');
exports.NoteStoreTypes = require('./lib/evernote-thrift/gen-nodejs/NoteStore_types');
exports.Types = require('./lib/evernote-thrift/gen-nodejs/Types_types');
-
@@ -0,0 +1,36 @@
+
+
+var authToken = "EVERNOTE_TOKEN"; //The token
+
+var config = require('../config.js');
+var Evernote = require('../evernode').Evernote;
+var util = require('util');
+
+var evernote = new Evernote(
+ config.evernoteConsumerKey,
+ config.evernoteConsumerSecret,
+ config.evernoteUsedSandbox
+ );
+
+ var note = { title: 'Hello World!!',
+ content: '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">\n'
+ +'<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">'
+ +'<div>Hello!!</div>'
+ +'<div></div>'
+ +'<div>This is a note created by Everest.js</div>'
+ +'</en-note>' }
+
+//Get the user object....
+evernote.getUser(authToken,function(err, edamUser) {
+
+ if (err) return console.log(err);
+
+ //Find the notes....
+ evernote.createNote(edamUser, note, function(err, note) {
+
+ if (err) return console.log(err);
+
+ return console.log(note);
+ });
+});
+

0 comments on commit c99b1be

Please sign in to comment.