It's in Italian since it just was an hobby project and I didn't spend too much time adapting it for the public domain, but it may be interesting for someone.
I have a Twitter bot that makes up book passages combining books from the Gutenberg project: https://twitter.com/markovian_lit
Code is also on GitHub if it interests anyone - not the prettiest, but it was fun to build :-)