Skip to content

Instantly share code, notes, and snippets.

@evernotegists
Created April 4, 2013 20:12
Show Gist options
  • Save evernotegists/5313917 to your computer and use it in GitHub Desktop.
Save evernotegists/5313917 to your computer and use it in GitHub Desktop.
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)
sharedNotes += noteList.notes
except (EDAMNotFoundException, EDAMSystemException, EDAMUserException), e:
print "Error getting shared notes:"
print type(e), e
return None
if len(sharedNotes) % 50 != 0:
## We've retrieved all of the notes
break
else:
offset += 50
return sharedNotes[:maxCount]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment