Created
December 10, 2014 01:54
-
-
Save willwangcc/47b6267583ffabeffc4c to your computer and use it in GitHub Desktop.
Export/Download Your Kindle Highlights into text at MAC.
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
#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