Make Blogger Single Posts Book by (Feed) Index Range - GAS program - Test version

Last updated on 9 Sep. 2023 

9 Sep. 2023 Update: I rarely use the software covered in this post now. To see the current software for creating Blogger blogbooks that I use, please visit: Short User Guide to creating Blogger Blogbooks from Backup/Export File using ExportFileFilterAndGenBook and another VBA projects' macros/code (free and open source), https://ravisiyermisc.blogspot.com/2023/09/short-user-guide-to-creating-blogger.html .

end-Update 9 Sep. 2023

I decided to put up and publish this post now on 22 Jul 2023 while this work is in progress, as I wanted to ensure that whatever work I have done till now is available for interested readers. 

This work follows up on work covered in my previous post: Make Blogger Posts Book(s) by (Feed) Index Range or Index List; List Posts By Index - GAS programs - Test versions, https://ravisiyermisc.blogspot.com/2023/07/make-blogger-posts-books-by-index-range.html .

The makePostsBookByIndexRange covered in above post has one limitation which is that the book part created when blog url (using blog name/address and not blog ID) is passed can be maximum of 150 posts. If the index range is beyond 150 posts then multiple book parts are produced by makePostsBookByIndexRange. Note that if makePostsBookByIndexRange is modified to also allow for blog ID parameter along with blog url parameter then it will be able to create book parts having up to 500 posts. But blog ID may be hard to find for blogs owned and operated by others.

makeSinglePostsBookByIndexRange overcomes this limitation of 150 posts per book part (or of 500 posts per book part if blog ID is used instead of blog url). makeSinglePostsBookByIndexRange creates blog book for the range in html and not as Google Document (and makePostsBookByIndexRange also creates html output files). As html uses linked pictures and not embedded pictures, the size of the output file is reduced. Note that if Google Document is produced like in the case of BlogBooksMaker project (https://ravisiyermisc.blogspot.com/2023/07/blogbooksmaker-google-apps-script-to.html ) then perhaps the pictures are embedded in the document due to which the output document file is much, much bigger in size. As an example, for my small blog of around 20 posts - tnarayanasasthri.blogspot.com - BlogBooksMaker produced output Google Docs document is 5 MB in size, whereas makeSinglePostsBookByIndexRange output html file is only 479 KB! For my spiritual blog - ravisiyer.blogspot.com, BlogBooksMaker produced output Google Docs documents total size is over 100 MB (35 documents as it was invoked for every year with some years posts running into multiple blog book parts of max. 50 posts), whereas makeSinglePostsBookByIndexRange output html file is 14.2 MB! [Note that using BlogBooksMaker with even 100 posts per book part for some blogs was causing the program to give a drive.files.insert error which I believe is related to Google Drive execution limits for free users like me. So BlogBooksMaker code was changed to have a maximum of 50 posts per blog book part. For more details, please see section titled, "3rd July 2023, around 7 PM Update start:", "version 4 of BlogBooksMaker Project - Drive API error" in https://ravisiyermisc.blogspot.com/2023/06/google-apps-script-to-create-blogger.html .]

There is the issue of a blog book part, even if it uses linked pictures, being too big for programs like browsers to handle. In the above two cases, tnarayanasasthri.blogspot.com output html file of 479 KB is no problem at all for browsers like Chrome, but browsers (both Edge and Chrome) choke (don't work) on ravisiyer.blogspot.com output html file as its size of 14.2 MB is just too big for them (when running on my 4 GB RAM Windows PC). However Notepad++ opens the 14.2 MB file fast but as a text file with some tags being highlighted and not rendered as HTML. After opening it in Notepad++, one can search for text and that is fast. So Notepad++ allows for searching through entire blog html file (of 14.2 MB in case of ravisiyer.blogspot.com) which I think can be a very useful facility for some needs.

What makeSinglePostsBookByIndexRange allows the user to do, is to make a few trial runs with it and come up with the right Index range to be used for book parts when a large blog is the input for the blog book parts. I used this facility and came up with 500 posts per blog book for ravisiyer.blogspot.com as a good size. This resulted in 3 html blog books for ravisiyer.blogspot.com and all 3 could be opened by Chrome on PC though it took some time to load the document fully. Note that if it is a small blog then makeSinglePostsBookByIndexRange can be used to produce a single blog book for the whole blog.

The html files produced can be converted to Word .docx files after which title text, page numbers and Table of Contents can be added to the .docx file. Then the .docx document can be saved as (minimum size) PDF and that PDF file can be shared.

A few sample output files are given below (files need to be downloaded to PC and then viewed locally in browser or other program, as Google Drive viewer is not able to provide good rendering (preview) of these files, at least when I use it; for the links below while preview is shown, a download link is provided at the top right of the window):
Info. about the test runs are given below (including both of the cases mentioned above). All relevant files are in v1 folder of makeSinglePostsBookByIndexRange folder shared here:  https://drive.google.com/drive/folders/1hG3g4N98ShhGX4jbA_zUahxNdK32BFZ0?usp=drive_link .
  1. Making one full blog book in html (with linked and not embedded pics) for tnarayanasasthri.blogspot.com having total of only 20 posts:  'tnarayanasasthri.blogspot.com Max. 2000 posts.html' (in last part of name 'Max. 2000 posts' should be changed to full blog), 479 KB. No problem for Chrome to open file. For run info. see R1-RunInfo-ExecLog.txt.
  2. Making one full blog book for eklavyasai.blogspot.com having total of 216 posts:  'eklavyasai.blogspot.com Max. 2000 posts.html' (in last part of name 'Max. 2000 posts' should be changed to full blog), 1954 KB. No problem for Chrome to open file. For run info. see R2-RunInfo-ExecLog.txt.
  3. Making one full blog book for ravisiyermisc.blogspot.com having total of 1065 posts:  'ravisiyermisc.blogspot.com Max. 2000 posts.html' (in last part of name 'Max. 2000 posts' should be changed to full blog), 10229 KB. Chrome showed initial part of above large html file and showed an in-progress indicator but eventually failed to open/load it completely and gave an "Out of Memory" error. Notepad++ opens it as text file with some tag info. and does fast search for text in it but Notepad++ does not render in HTML. For run info. see R3-RunInfo-ExecLog.txt.
  4. Making one full blog book for ravisiyer.blogspot.com having total of 1474 posts:  'ravisiyer.blogspot.com Max. 2000 posts.html' (in last part of name 'Max. 2000 posts' should be changed to full blog), 14614 KB. Chrome could not open this very large file. Notepad++ opens it as text file with some tag info. and does fast search for text in it but Notepad++ does not render in HTML. For run info. see R4-RunInfo-ExecLog.txt.
  5. Making two part full blog books for ravisiyermisc.blogspot.com having total of 1065 posts: Output files are 'ravisiyermisc.blogspot.com Part 1 of 2.html', 6072 KB, having 550 posts  (I did not count number of posts in output file but execution log indicates 550 posts) and 'ravisiyermisc.blogspot.com Part 2 of 2.html', 4158 KB, having the remaining posts (515 as per execution log). On my 4 GB RAM PC, Chrome opened Part 1 after taking a lot of time to load. But it did open it and I was able to browse through it quite comfortably. As Part 2 is smaller than Part 1, as expected, Chrome opened Part 2 too. I was able to open both html files in Word 2007, add title, page number and TOC and save as PDF of minimum size (linked pictures I presume). Output PDF files are: "ravisiyermisc.blogspot.com Part 1 of 2.pdf", filesize 23,338 KB and of 2359 pages, and "ravisiyermisc.blogspot.com Part 2 of 2.pdf", filesize 11,304 KB and of 1438 pages. Chrome has no problem opening these PDF files. 
  6. For run info. see R5-RunInfo-ExecLog.txt.
  7. Making three part full blog books for ravisiyer.blogspot.com having total of 1474 posts: Output files are 'ravisiyer.blogspot.com Part 1 of 3.html', 4311 KB, having 500 posts (I did not count number of posts in output file but execution log indicates 500 posts), 'ravisiyer.blogspot.com Part 2 of 3.html', 5045 KB, having 500 posts (as per execution log) and 'ravisiyer.blogspot.com Part 3 of 3.html', 5260 KB, having the remaining posts (474 as per execution log). On my 4 GB RAM PC, Chrome opened all three Parts (one part at a time) after taking a lot of time to load. But it did open them and I was able to browse through them quite comfortably. I was able to open all three html files in Word 2007, add title, page number and TOC and save as PDF of minimum size (linked pictures I presume). Output PDF files are: 'ravisiyer.blogspot.com Part 1 of 3.pdf', filesize 31734 KB and of 2046 pages, 'ravisiyer.blogspot.com Part 2 of 3.pdf', filesize 18798 KB and of 1936 pages, and 'ravisiyer.blogspot.com Part 3 of 3.pdf', filesize 15984 KB and of 1607 pages. Spotted one small issue of pics exceeding page size for 1 post in part 3 pdf. The fixed PDF details are: 'ravisiyer.blogspot.com Part 3 of 3-LargePicFix.pdf', filesize 14776 KB. Chrome has no problem opening these PDF files. For run info. see R6-RunInfo-ExecLog.txt.

Comments

Archive

Show more