Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

CreatNote example case

  • Loading branch information...
commit c99b1be331df54b81cc8d41c608ea56bae53bef6 1 parent dc5b42c
Wanasit Tanakitrungruang authored March 08, 2013
3  everest.js
@@ -422,9 +422,6 @@ app.all('/notebooks/:guid/expunge', function(req, res){
422 422
   });
423 423
 });
424 424
 
425  
-
426  
-
427  
-
428 425
 //===================================================
429 426
 //									  Sync
430 427
 //===================================================
1  evernode/index.js
@@ -6,4 +6,3 @@ exports.UserStore = require('./lib/evernote-thrift/gen-nodejs/UserStore')
6 6
 exports.NoteStore = require('./lib/evernote-thrift/gen-nodejs/NoteStore');
7 7
 exports.NoteStoreTypes = require('./lib/evernote-thrift/gen-nodejs/NoteStore_types');
8 8
 exports.Types 				 = require('./lib/evernote-thrift/gen-nodejs/Types_types');
9  
-  
36  examples/CreateNote.js
... ...
@@ -0,0 +1,36 @@
  1
+
  2
+
  3
+var authToken = "EVERNOTE_TOKEN"; //The token
  4
+
  5
+var config   = require('../config.js');
  6
+var Evernote = require('../evernode').Evernote;
  7
+var util = require('util');
  8
+
  9
+var evernote = new Evernote(
  10
+    config.evernoteConsumerKey,
  11
+    config.evernoteConsumerSecret,
  12
+    config.evernoteUsedSandbox
  13
+  );
  14
+
  15
+  var note = { title: 'Hello World!!', 
  16
+    content: '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">\n'
  17
+    +'<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">'
  18
+    +'<div>Hello!!</div>'
  19
+    +'<div></div>'
  20
+    +'<div>This is a note created by Everest.js</div>'
  21
+    +'</en-note>' }
  22
+
  23
+//Get the user object....
  24
+evernote.getUser(authToken,function(err, edamUser) {
  25
+	
  26
+	if (err)  return console.log(err);
  27
+  
  28
+  //Find the notes....
  29
+  evernote.createNote(edamUser,  note, function(err, note) {
  30
+    
  31
+    if (err)  return console.log(err);
  32
+    
  33
+    return console.log(note);
  34
+  });
  35
+});
  36
+

0 notes on commit c99b1be

Please sign in to comment.
Something went wrong with that request. Please try again.