Added Page Having Dynamically Generated List Of All Posts On My Blogger Blogs Using Shared Javascript code

Last updated on 3 Jul 2025
30 Jun - 3 Jul 2025 Update

The Javascript code for the implementation referred below did not work properly over past few days for my raviswdev.blogspot.com blog. It was omitting listing posts after the 13 Oct. 2024 post till 21 March 2024 post. Note that this code had seemed to be working well for the aforementioned blog for over a year, IFIRC. But I had not done extensive testing and so perhaps there were some omissions which I had not noted.

On debugging the code yesterday with Gemini's help, the issue found was ...

Me: API Call (Start Index: 1, Max Results: 150): Received 52 entries.
API Call (Start Index: 151, Max Results: 150): Received 40 entries.
===========
So the first API call gets only 52 entries and our start index jumps to 151 for next call. Hmm. Does blogger API say that it could return less than max results even if more posts than max results match the request?

Gemini: ...

Does Blogger API say that it could return less than max results even if more posts than max results match the request?

Yes, the Blogger API (specifically the older Data API v2.0, which you're using with alt=json-in-script) can and often does return fewer results than max-results, especially if it hits the end of available results, or if there's an internal limit/issue.

Here's a breakdown of what's likely happening and why your posts are being omitted:

  1. Invisible/Soft Limit (Most Likely): While max-results allows you to request up to 500 (or sometimes 999 depending on the feed type), there seems to be an undocumented or "soft" internal limit on how many posts the summary feed (/feeds/posts/summary) will return for a blog, particularly for older blogs or those with specific content types. Many developers have reported that this feed often stops returning posts after a certain number (e.g., around 50-100 posts, or a specific date range), regardless of how high max-results or start-index are set.

  2. Deprecation of Data API v2.0: The Blogger Data API v2.0 (which alt=json-in-script relies on) was officially deprecated by Google and has been largely replaced by Blogger API v3.0. Although Google stated that some GET requests (like feeds) would continue to be supported, they also mentioned "minor differences in their behavior" and encouraged migration. It's highly probable that this "minor difference" includes a reduced reliability or implicit limit on how many historical posts the v2 feeds will expose.

=======

Later I got specific info. about v2.0 deprecation. From Deprecation notice: Blogger v2.0 GData API scheduled for sunset, https://support.google.com/blogger/answer/14877110 :

Since the Google Data APIis an old API protocol and Blogger already supports the new version 3.0 API, Blogger will no longer support the Blogger version 2.0 GData API. If you still use the Blogger version 2.0 GData API and continue to use a Blogger API, you can migrate to the latest Blogger API v3.0. On September 30, 2024, there’s a plan to shut down version 2.0 GData API .
...
The version 2.0 GData API URLs are used as feed URLs. Will such feeds be unavailable too?
We continue to serve feeds for such URLs. But the response is the same as blogspot.com feeds like https://{your_subdomain}.blogspot.com/feeds/posts/default and can be slightly different from the original.
--- end extracts ---

Gemini helped me with code for Blogger API v3.0 which needed to use a Google Cloud project API key. That worked. Later it was enhanced to be a generic app for any Blogger blog. For more, please visit: Blogger Posts Lister Web App: Dynamically Generates List Of All Posts On Blogger Blogs Using Blogger API v3.0.

end 30 Jun  - 3 Jul 2025 Update

In March of this year (2023), I changed the blogger theme of this (worldly) blog (ravisiyermisc.blogspot.com) as well as of my main spiritual blog (ravisiyer.blogspot.com) from 'Simple Bold' theme to 'Contempo Light' to ensure that search blog facility was provided when viewing the blogs on mobile. For more details, please visit my post: In Blogger, showing search button (facility) in mobile view by changing Theme from Simple Bold to Contempo Light, https://ravisiyermisc.blogspot.com/2023/03/in-blogger-showing-search-button.html .

After this change, I saw that the Archive gadget functionality gave a limited view of archived posts in one view as compared to what the Archive gadget did with 'Simple Bold' theme. You could usually see only one month's posts in one view and had to click a button to see another month's view at which time the previously selected month's posts would not be shown. I very much wanted to provide visitors to my blog, as well as myself, an easy way to see a list of all posts in the blog which is dynamically generated through a gadget or otherwise. A few days back I came across some Javascript code solutions for this need. Yesterday (23rd Jun 2023), I was able to successfully implement one of these solutions to both the above mentioned blogs. 

As both my blogs have over a thousand posts, the Javascript code takes time to execute and sometimes the page load (dynamically generated list) gets completed very slowly.

You can view the "List of Posts in Blog In Reverse Chronological Order - Dynamically Generated" in the two blogs here:

1) (This) Worldly blog: https://ravisiyermisc.blogspot.com/p/list-of-posts-in-blog-in-reverse.html

2) Spiritual blog: https://ravisiyer.blogspot.com/p/list-of-posts-in-blog-in-reverse.html

I also created a "Static Copy of List of Posts in Blog In Reverse Chronological Order taken on 23 June 2023" for both the blogs. These static pages load faster as they have the list of posts as HTML. You can view them here:

1) (This) Worldly blog: https://ravisiyermisc.blogspot.com/p/static-copy-of-list-of-posts-in-blog-in_23.html

2) Spiritual blog: https://ravisiyer.blogspot.com/p/static-copy-of-list-of-posts-in-blog-in.html

The Javascript provided in the dynamically generated list pages mentioned earlier (not static pages which have the generated HTML for the list of posts) is from the post titled, "Create an Archive List/Page for Blogger", https://www.sarwrites.com/2015/09/create-archive-listpage-for-blogger.html , created in Sept. 2015 and last updated on August 2018. Many thanks to the author of the post. I also came across an error in the script which has already been pointed out by Anonymous comment dated April 25, 2018 about "601+150=751 not 851". I fixed the error and now the script works.

I thought it may help some if I provide the entire HTML including script for the above dynamically generated list pages. But I am not sure about the copyright status of the original code and so decided not to put up the HTML and script code on this post.

Comments

Archive

Show more