Skip to content

Instantly share code, notes, and snippets.

@willwangcc
Created December 10, 2014 01:54
Show Gist options
  • Save willwangcc/47b6267583ffabeffc4c to your computer and use it in GitHub Desktop.
Save willwangcc/47b6267583ffabeffc4c to your computer and use it in GitHub Desktop.
Export/Download Your Kindle Highlights into text at MAC.
#author:hellosec via http://www.zhihu.com/question/23031778
#instructions:only text(time & position omitted)
import os
note_path='/Volumes/Kindle/documents/My Clippings.txt'
f=open(note_path,'r+')
digest_path='/Users/yangxin/Desktop/digest/'
os.mkdir(digest_path)
while True:
onenote=[]
for i in range(0,5):
line=f.readline()
if not line:
exit()
onenote.append(line)
book_note=open('%s%s.txt'%(digest_path,onenote[0]),'a+')
book_note.write(onenote[3]+'\n')
book_note.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment