#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
#!/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)
Source: https://habr.com/ru/post/57807/
All Articles