This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE en-export SYSTEM "http://xml.evernote.com/pub/evernote-export3.dtd"> | |
<en-export export-date="20130730T205637Z" application="Evernote" version="Evernote Mac"> | |
<note> | |
<title>Test Note for Export</title> | |
<content> | |
<![CDATA[<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd"> | |
<en-note style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> | |
Hello, World. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noteStore = client.get_note_store() | |
notebook = Types.Notebook() | |
notebook.name = "My Notebook" | |
notebook = noteStore.createNotebook(notebook) | |
print notebook.guid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noteStore = client.get_note_store() | |
note = Types.Note() | |
note.title = "I'm a test note!" | |
note.content = '<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE en-note SYSTEM "http://xml.evernote.com/pub/enml2.dtd">' | |
note.content += '<en-note>Hello, world!</en-note>' | |
note = noteStore.createNote(note) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noteStore = client.get_note_store() | |
notebooks = noteStore.listNotebooks() | |
for n in notebooks: | |
print n.name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter = NoteStore.NoteFilter() | |
filter.ascending = False | |
spec = NoteStore.NotesMetadataResultSpec() | |
spec.includeTitle = True | |
ourNoteList = noteStore.findNotesMetadata(authToken, filter, 0, 100, spec) | |
wholeNotes = [] | |
for note in ourNoteList.notes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
filter = NoteStore.NoteFilter() | |
filter.words = "created:month-3" | |
filter.notebookGuid = "SomeNotebookGuidHere" | |
filter.tagGuids = ["tagGuid1","tagGuid2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getAllSharedNotes(authToken, noteStore, maxCount=None): | |
noteFilter = NoteStore.NoteFilter() | |
noteFilter.words = "sharedate:*" | |
sharedNotes = [] | |
offset = 0 | |
if not maxCount: | |
maxCount = 500 | |
while len(sharedNotes) < maxCount: | |
try: | |
noteList = noteStore.findNotes(authToken, noteFilter, offset, 50) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def stopSharingSingleNote(authToken, noteStore, noteGuid): | |
try: | |
noteStore.stopSharingNote(authToken, noteGuid) | |
except (EDAMNotFoundException, EDAMSystemException, EDAMUserException), e: | |
print "Error stopping sharing note:" | |
print type(e), e | |
return None | |
return noteGuid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def shareSingleNote(authToken, noteStore, userStore, noteGuid, shardId=None): | |
""" | |
Share a single note and return the public URL for the note | |
""" | |
if not shardId: | |
shardId = getUserShardId(authToken, userStore) | |
if not shardId: | |
raise SystemExit | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def getUserShardId(authToken, userStore): | |
""" | |
Get the User from userStore and return the user's shard ID | |
""" | |
try: | |
user = userStore.getUser(authToken) | |
except (Errors.EDAMUserException, Errors.EDAMSystemException), e: | |
print "Exception while getting user's shardID:" | |
print type(e), e | |
return None |
OlderNewer