Recently, I wanted to create epubs of some reading material, specifically some Wordpress-hosted blogs. Rather than implementing a separate script for each blog I wanted an epub from, I wrote a tool to figure it all out for me: trivialpub.
Usage is simple: provide a YAML config file, such as:
https://gist.github.com/92ac1eeeb415da79bbbe2144df8af79d
And trivialpub will do the rest:
https://gist.github.com/0ecad63e83dd6a2c76234bd652e532e9
I've included a number of examples in the repo, but basically, you either need to feed it a list of URLs to transform or a Python expression which, when eval'ed in context, will generate a list of URLs. (Yes, yes, eval() is the devil, I know.)
PRs and suggestions welcome.