Created
August 2, 2018 18:50
-
-
Save kunanit/6ac27276e6ccc10e34e02309ab39303a to your computer and use it in GitHub Desktop.
Generate slice for every 100th revision
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
gdoc = gdocrevisions.GoogleDoc(...) | |
slices = [] # save things here | |
gdoc.content.reset() # reset document | |
for i, revision in enumerate(gdoc.revisions): | |
gdoc.content.apply(revision) # apply revision | |
if i%100==1: # every 100th revision | |
slices.append(gdoc.content.render()) # save document state to slices | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment