Evernote APIまたは象の中身は?

Habréに関する以前のブログ投稿へのコメントで、 Evernoteに独自のAPIがあると述べました。 今、彼についてもっと話したい。





Evernoteの同期プロトコルを開発しているとき、クロスプラットフォームソリューションを実現したかった(WebパーツはJavaで記述され、WindowsとWindows MobileのクライアントはC ++で、MacとiPhoneのクライアントはObjective-Cである)。 このプロトコルをさまざまなクライアントに簡単に実装し、必要に応じてこのプロトコルを拡張できるようにするものが必要でした。 さらに、転送されるデータの量を減らすために、このプロトコルを使用してバイナリデータを確実に転送したいと考えました。 選択は、Facebookで使用されている(そして現在も使用されている)プロトコルであるThriftで決まり、現在ではApache Incubatorの管理下にあるオープンソースプロジェクトになっています 。 Evernote開発者はプロジェクトの開発に携わり、バグを修正し、Java、Objective-C、Perlの実装とThriftを完成させました。



スリフトとは何ですか?



Thriftは、サーバー上の関数をリモートで呼び出すことができるRPC実装です。 Thriftは3つの主要な要素で構成されています。

  1. バイナリプロトコル-データ構造をパックする方法。
  2. オブジェクト、そのプロパティ、およびメソッドを記述するための独自の宣言型言語。
  3. さまざまな言語(Java、C、Ruby、Python、Perl、PHPなど)のコードジェネレーター。記述されたオブジェクトに基づいて、サーバーからオブジェクトを受け取り、それらのメソッドを完全に透過的に呼び出すことができるネイティブコードを生成します。


そのため、Evernote APIは、Thriftで説明されている私たち固有のオブジェクト(ユーザー、メモ帳、メモなど)とそのプロパティの実装にすぎません。 既存のEvernoteクライアントはすべてこのAPIを使用するため、敵と敵を区別することはできません。 すべてのアプリケーション-私たちのアプリケーションとサードパーティのアプリケーション-の権利は等しく、同じ機能を使用します。



Evernote APIの目的は何ですか?



APIを使用する主な方法は2つあります。



1)Evernoteのクライアントアプリケーションを作成します。 この場合、クライアントアプリケーションは特定のユーザーの名前とパスワードでシステム内で承認され、すべてのオブジェクトにアクセスできます。 この方法は、1人の特定のEvernoteユーザーのみと連携するサービスに使用する必要があります。



2)システム自体と連携するためのサードパーティサービス用の統合モジュール(プラグイン)の作成。 この場合、 OAuthプロトコルを使用します。これにより、Evernoteユーザーは、パスワードを開示する必要なく、アカウントへの外部アプリケーションへの制限付きアクセスを提供できます。 この方法は、複数のEvernoteユーザーと連携するサービスに使用する必要があります。



Evernote APIのアイデア



1)特定のノートブックからEvernoteにブログノートを自動的に投稿する人気のあるブログエンジン(WordPressなど)のプラグイン。 なんで? Evernoteクライアントで、ブログ投稿をオフラインで準備できると想像してください。 ブログの情報を収集する場所。 これは、Evernoteが提供する情報を入力する便利さと、ブログエンジンが提供するエントリの外観とコメントをカスタマイズするための巨大なオプションです。



2)特定のクライアントとクリッパー。 たとえば、カメラからバーコードを認識し、このバーコードからインターネット上の情報を受け取り、Evernoteでメモを作成するアプリケーション。 なんで? 店内を歩き回り、携帯電話で商品(たとえば本)の値札を撮影し、自宅でEvernoteですでに好きな商品を比較し、商品に関する追加情報、価格をオンラインストアから取得しています。 これには、Webカメラからの写真のキャプチャや、TWAINを介したスキャナーとの統合も含まれます。



3)症例計画システムとのコミュニケーション。 Evernoteクライアントから「明日のオフィスでの11のビジネスミーティング」などのメモを入力すると、リマインダーが設定されたタスクがGoogleカレンダー、Remember The Milkなどのサービスに分類され、SMSまたは電子メールで計画されたケースが通知されることを想像してください。



4) EvernoteとTwitterの統合との類推により、ICQ、XMPP(Jabber)からSMS経由でインポートサービスを思い付くことができます。



あなた自身がEvernoteと統合する他の興味深い方法を思い付くと思います。 すでに世界中に900,000人のEvernoteユーザーがいます。Evernoteと対話することは、製品に価値を加える良いチャンスです。 実装された統合例の一部については、 英語のブログで読むことができます。



どこから始めますか?



APIの試用は非常に簡単です-使用例とインターフェイスライブラリを含むこのページにある目的のSDKをダウンロードし、そこにAPIキーのリクエストを送信し、簡単に自分自身について書きます(プロジェクトの名前、APIが必要な理由、使用方法)。 キーを受け取った後、特別なサンドボックステストサーバーでAPIを安全に試すことができます。 「サンドボックス」で作業するには、別のEvernoteユーザーアカウントを作成する必要があることに注意してください。このサーバーは、メインのものと重複しない独自のユーザーデータベースを使用するためです。



開発者向けフォーラムにアクセスして、APIに関する質問をしてください。 またはここで質問してください-私たちは助けようとします。



それとは別に、Evernote APIのライセンスは開発者がアプリケーションを配布する方法を制限しないことに注意する価値があります。 これには、無料の商用開発、オープンソースプロジェクト、クローズドソースプロジェクトがあります。 すべてはあなたの裁量に残ります。



コード例



最後に、ユーザーを名前とパスワードで認証し、STDINからメモの本文を読み取り、サーバー上にメモを作成するPythonコードの例を示します。

  1. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  2. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  3. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  4. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  5. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  6. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  7. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  8. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  9. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  10. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  11. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  12. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  13. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  14. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  15. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  16. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  17. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  18. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  19. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  20. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  21. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  22. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  23. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  24. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  25. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  26. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  27. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  28. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  29. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  30. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  31. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  32. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  33. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  34. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  35. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  36. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  37. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  38. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  39. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  40. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  41. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  42. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  43. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  44. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  45. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  46. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  47. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  48. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  49. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  50. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  51. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  52. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  53. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  54. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  55. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  56. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  57. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  58. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  59. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  60. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  61. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  62. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  63. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  64. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  65. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  66. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  67. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  68. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  69. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  70. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  71. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  72. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)



  73. #!/usr/bin/python # coding=utf-8 # ( Evernote API) import time import thrift.transport.THttpClient as THttpClient import thrift.protocol.TBinaryProtocol as TBinaryProtocol import evernote.edam.userstore.UserStore as UserStore import evernote.edam.userstore.constants as UserStoreConstants import evernote.edam.notestore.NoteStore as NoteStore import evernote.edam.type.ttypes as Types # edamHost = "sandbox.evernote.com" # -"", edamPort = 443 # consumerKey = "your-api-key-here!" # , Evernote consumerSecret = "your-api-secret-here!" # , Evernote username = "your-username" # Evernote ( sandbox.evernote.com) password = "your-password" # Evernote # HTTP UserStore ( ) userStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, "/edam/user" ) userStoreProtocol = TBinaryProtocol.TBinaryProtocol(userStoreHttpClient) userStore = UserStore.Client(userStoreProtocol) # , versionOK = userStore.checkVersion( "Python EDAMTest" , UserStoreConstants.EDAM_VERSION_MAJOR, UserStoreConstants.EDAM_VERSION_MINOR) print "Is my EDAM protocol version up to date? " , str(versionOK) if not versionOK: exit(1) # authResult = userStore.authenticate(username, password, consumerKey, consumerSecret) # User user = authResult.user # authToken = authResult.authenticationToken print "Authentication was successful for " , user.username print "Authentication token = " , authToken # HTTP NoteStore ( ) noteStoreUri = "/edam/note/" + user.shardId noteStoreHttpClient = THttpClient.THttpClient(edamHost, edamPort, noteStoreUri) noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient) noteStore = NoteStore.Client(noteStoreProtocol) # notebooks = noteStore.listNotebooks(authToken) # STDOUT , # print "Found " , len(notebooks), " notebooks:" for notebook in notebooks: print " * " , notebook.name if notebook.defaultNotebook: defaultNotebook = notebook # print print "Creating a new note in default notebook: " , defaultNotebook.name print # note = Types.Note() # note.notebookGuid = defaultNotebook.guid # note.title = raw_input( "Note title? " ).strip() # ENML ( XHTML ) note.content = '<?xml version="1.0" encoding="UTF-8"?>' note.content += '<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml.dtd">' note.content += '<en-note>' note.content += raw_input( "Well-formed XHTML note content? " ).strip() # XTML STDIN note.content += '</en-note>' # note.created = int (time.time() * 1000) # note.updated = note.created # , createdNote = noteStore.createNote(authToken, note) print "Created note: " , str(createdNote)






All Articles