Sunday, March 06, 2022

google apps script to turn blog posts into an ebook - no oauth required

It turns out that all the complicated steps I went through in the previous post were not necessary. Blogs on blogger provide a feed url which returns xml or json as you prefer, with no need for authentication for public blogs. My code is at https://github.com/hn-88/bloggerToEbook and the feed url, for reference, is like 
https://domainnameofblog.tld/feeds/posts/default/-/relevant-label?max-results=100&alt=json

If we want to narrow down results via posted date,
shows us that we need to add the following to the url above - 
&updated-min=2008-03-16T00:00:00&updated-max=2008-03-24T23:59:59&orderby=updated

After downloading the Google Doc as an EPUB, I did a couple of tweaks to make it read better on the Kindle when converting to MOBI with Calibre. Turning the green text to black, by ticking the 'Color' box to ignore,


and also auto-generating Table of Contents,



I had also increased the number of links to add to Table of Contents from 50 to 500 in the screen above, since I was making ebooks with 100 or 150 posts each. 

Edit: Bloxp.com is one of the high ranked google results for turning a blog into an ebook. But right now it doesn't seem to be working - tried both with Blogger feeds as well as rss feeds from https://www.thehindu.com/rssfeeds/

Edit 2: Another way to turn blog posts into an ebook, mentioned at
is

This seems to be dead now. archive.org shows that it redirects to pothi.com now. 

No comments:

Post a Comment